吕黎明 6 лет назад
Родитель
Сommit
69835e89e0
80 измененных файлов с 1636 добавлено и 841 удалено
  1. 15 8
      src/app.js
  2. 69 63
      src/app.json
  3. 50 28
      src/app.wxss
  4. 5 5
      src/config.js
  5. BIN
      src/img/ball.png
  6. BIN
      src/img/fanhui.png
  7. BIN
      src/img/icon/10124949Normal.png
  8. BIN
      src/img/icon/img_homeNormal.png
  9. BIN
      src/img/left.png
  10. BIN
      src/img/link1.png
  11. BIN
      src/img/link11.png
  12. BIN
      src/img/link12.png
  13. BIN
      src/img/link3.png
  14. BIN
      src/img/link4.png
  15. BIN
      src/img/link5.png
  16. BIN
      src/img/link6.png
  17. BIN
      src/img/link8.png
  18. BIN
      src/img/link9.png
  19. BIN
      src/img/mark.png
  20. BIN
      src/img/right.png
  21. BIN
      src/img/star1.png
  22. BIN
      src/img/star2.png
  23. BIN
      src/img/text_bao.png
  24. 0 0
      src/img/weather/tianqi01@2x.png
  25. 0 0
      src/img/weather/tianqi02@2x.png
  26. 0 0
      src/img/weather/tianqi03@2x.png
  27. 0 0
      src/img/weather/tianqi04@2x.png
  28. 0 0
      src/img/weather/tianqi05@2x.png
  29. BIN
      src/img/zhuanfa.png
  30. BIN
      src/img/发现icon/IOS/faxian_wx@1x.png
  31. BIN
      src/img/发现icon/IOS/faxian_wx@2x.png
  32. BIN
      src/img/发现icon/IOS/faxian_xz@1x.png
  33. BIN
      src/img/发现icon/IOS/faxian_xz@2x.png
  34. BIN
      src/img/天气图标/IOS/tianqi01@1x.png
  35. BIN
      src/img/天气图标/IOS/tianqi02@1x.png
  36. BIN
      src/img/天气图标/IOS/tianqi02@3x.png
  37. BIN
      src/img/天气图标/IOS/tianqi03@1x.png
  38. BIN
      src/img/天气图标/IOS/tianqi03@3x.png
  39. BIN
      src/img/天气图标/IOS/tianqi04@1x.png
  40. BIN
      src/img/天气图标/IOS/tianqi04@3x.png
  41. BIN
      src/img/天气图标/IOS/tianqi05@1x.png
  42. BIN
      src/img/天气图标/IOS/tianqi05@3x.png
  43. 5 5
      src/pages/activityDetail/activityDetail.js
  44. 14 12
      src/pages/activityDetail/activityDetail.wxml
  45. 4 2
      src/pages/activityDetail/activityDetail.wxss
  46. 150 107
      src/pages/creatOrder/creatOrder.js
  47. 11 11
      src/pages/creatOrder/creatOrder.wxml
  48. 148 105
      src/pages/creatOrder1/creatOrder.js
  49. 10 10
      src/pages/creatOrder1/creatOrder.wxml
  50. 157 104
      src/pages/creatOrder2/creatOrder.js
  51. 10 10
      src/pages/creatOrder2/creatOrder.wxml
  52. 4 4
      src/pages/flashSale/index.js
  53. 4 4
      src/pages/freeGo/index.js
  54. 12 8
      src/pages/huiTravel/index.js
  55. 1 0
      src/pages/huiTravel/index.wxml
  56. 175 177
      src/pages/index/index.js
  57. 44 44
      src/pages/index/index.wxml
  58. 5 1
      src/pages/index/index.wxss
  59. 12 9
      src/pages/jiudian/index.js
  60. 47 13
      src/pages/jiudian/index.wxml
  61. 26 15
      src/pages/jiudian/index.wxss
  62. 83 0
      src/pages/link/link.js
  63. 3 0
      src/pages/link/link.json
  64. 168 0
      src/pages/link/link.wxml
  65. 97 0
      src/pages/link/link.wxss
  66. 4 4
      src/pages/me/me.js
  67. 13 10
      src/pages/menpiao/index.js
  68. 45 12
      src/pages/menpiao/index.wxml
  69. 5 0
      src/pages/menpiao/index.wxss
  70. 1 1
      src/pages/needKnow/needKnow.wxml
  71. 48 21
      src/pages/orderDetail/orderDetail.js
  72. 3 3
      src/pages/orderDetail/orderDetail.wxml
  73. 2 2
      src/pages/orderDetail/orderDetail.wxss
  74. 5 1
      src/pages/repay/repay.js
  75. 60 2
      src/pages/selectOwner/editOwner.js
  76. 4 4
      src/pages/selectOwner/editOwner.wxml
  77. 75 18
      src/pages/selectOwner/selectOwner.js
  78. 11 12
      src/pages/selectOwner/selectOwner.wxml
  79. 3 1
      src/pages/travel/detail.wxss
  80. 28 5
      src/project.config.json

+ 15 - 8
src/app.js

@@ -1,26 +1,33 @@
 import wxPromisify from './lib/wx/wx.js';
-import { getRandomNum } from './lib/util/util.js';
+import {
+  getRandomNum
+} from './lib/util/util.js';
 import config from './config.js';
 import shuoAPI from './common/api/api.js';
 import shuoUser from './common/user/user.js';
 App({
-  onLaunch: function () {
-    shuoAPI.onError(function (err) {
+  onLaunch: function() {
+    shuoAPI.onError(function(err) {
       if (err.code === 401) { //401:session验证失败
         // 重新登录
         shuoAPI.wechatUserLogin();
       }
-      wxPromisify.showModal({ content: "" + err, showCancel: false });
+      wxPromisify.showModal({
+        content: "" + err,
+        showCancel: false
+      });
     });
     console.log("onLaunch...");
   },
   // 获得标语
-  getSlogan: function () {
+  getSlogan: function() {
     let max = config.sloganArr.length - 1;
     let n = getRandomNum(0, max);
     return config.sloganArr[n];
   },
-  onError: function (e) {
-    wxPromisify.showModal({ content: e });
+  onError: function(e) {
+    wxPromisify.showModal({
+      content: e
+    });
   }
-})
+})

+ 69 - 63
src/app.json

@@ -1,64 +1,70 @@
-{
-  "pages": [
-    "pages/index/index",
-    "pages/orderDetail/orderDetail",
-    "pages/activityDetail/activityDetail",
-    "pages/myOrder/myOrder",
-    "pages/repay/repay",
-    "pages/creatOrder/creatOrder",
-    "pages/creatOrder1/creatOrder",
-    "pages/creatOrder2/creatOrder",    
-    "pages/me/me",
-    "pages/flashSale/index",
-    "pages/menpiao/index",
-    "pages/jiudian/index",
-    "pages/freeGo/index",
-    "pages/performance/index",
-    "pages/huiTravel/index",
-    "pages/travel/detail",
-    "pages/reverse/index",
-    "pages/reverse1/index",    
-    "pages/ditu/index",
-    "pages/needKnow/needKnow",
-    "pages/needKnow1/needKnow",
-    "pages/needKnow2/needKnow",    
-    "pages/selectOwner/selectOwner",
-    "pages/selectOwner/editOwner"
-  ],
-  "window": {
-    "backgroundTextStyle": "light",
-    "navigationBarBackgroundColor": "#fff",
-    "navigationBarTitleText": "囡囡旅行",
-    "navigationBarTextStyle": "black"
-  },
-  "tabBar": {
-    "color": "#555555",
-    "selectedColor": "#0EA79B",
-    "list": [
-      {
-        "pagePath": "pages/index/index",
-        "text": "首页",
-        "iconPath": "/img/icon/home_s copyNormal_1.png",
-        "selectedIconPath": "/img/icon/home_s copyNormal.png"
-      },
-      {
-        "pagePath": "pages/flashSale/index",
-        "text": "惠旅游",
-        "iconPath": "/img/icon/box_n copyNormal.png",
-        "selectedIconPath": "/img/icon/box_n copyNormal_1.png"
-      },
-      {
-        "pagePath": "pages/huiTravel/index",
-        "text": "发现",
-        "iconPath": "/img/icon/find.png",
-        "selectedIconPath": "/img/icon/find1.png"
-      },
-      {
-        "pagePath": "pages/me/me",
-        "text": "我的",
-        "iconPath": "/img/icon/me_n copyNormal.png",
-        "selectedIconPath": "/img/icon/me_n copyNormal_1.png"
-      }
-    ]
-  }
+{
+  "pages": [
+    "pages/index/index",
+    "pages/orderDetail/orderDetail",
+    "pages/activityDetail/activityDetail",
+    "pages/myOrder/myOrder",
+    "pages/repay/repay",
+    "pages/creatOrder/creatOrder",
+    "pages/creatOrder1/creatOrder",
+    "pages/creatOrder2/creatOrder",
+    "pages/me/me",
+    "pages/flashSale/index",
+    "pages/menpiao/index",
+    "pages/jiudian/index",
+    "pages/freeGo/index",
+    "pages/performance/index",
+    "pages/huiTravel/index",
+    "pages/travel/detail",
+    "pages/reverse/index",
+    "pages/reverse1/index",
+    "pages/ditu/index",
+    "pages/needKnow/needKnow",
+    "pages/needKnow1/needKnow",
+    "pages/needKnow2/needKnow",
+    "pages/selectOwner/selectOwner",
+    "pages/selectOwner/editOwner",
+    "pages/link/link"
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "囡囡旅行",
+    "navigationBarTextStyle": "black"
+  },
+  "tabBar": {
+    "color": "#555555",
+    "selectedColor": "#0EA79B",
+    "list": [
+      {
+        "pagePath": "pages/index/index",
+        "text": "首页",
+        "iconPath": "/img/icon/home_s copyNormal_1.png",
+        "selectedIconPath": "/img/icon/home_s copyNormal.png"
+      },
+      {
+        "pagePath": "pages/flashSale/index",
+        "text": "惠旅游",
+        "iconPath": "/img/icon/box_n copyNormal.png",
+        "selectedIconPath": "/img/icon/box_n copyNormal_1.png"
+      },
+      {
+        "pagePath": "pages/huiTravel/index",
+        "text": "发现",
+        "iconPath": "/img/icon/find.png",
+        "selectedIconPath": "/img/icon/find1.png"
+      },
+      {
+        "pagePath": "pages/me/me",
+        "text": "我的",
+        "iconPath": "/img/icon/me_n copyNormal.png",
+        "selectedIconPath": "/img/icon/me_n copyNormal_1.png"
+      }
+    ]
+  },
+  "permission": {
+    "scope.userLocation": {
+      "desc": "你的位置信息将用于小程序位置接口的效果展示"
+    }
+  }
 }

+ 50 - 28
src/app.wxss

@@ -319,7 +319,12 @@ flex-jcc {
 .pt20 {
   padding-top: 20rpx;
 }
-
+.pt30{
+  padding-top: 30rpx;
+}
+.pt40{
+  padding-top: 40rpx;
+}
 .ptb20 {
   padding: 20rpx 0;
 }
@@ -331,7 +336,9 @@ flex-jcc {
 .pb20 {
   padding-bottom: 20rpx;
 }
-
+.pb30{
+  padding-bottom: 30rpx;
+}
 .pb40 {
   padding-bottom: 40rpx;
 }
@@ -388,6 +395,12 @@ flex-jcc {
   margin-left: 20rpx;
 }
 
+.ml30 {
+  margin-left: 30rpx;
+}
+.mr5{
+  margin-right: 5rpx;
+}
 .mr10 {
   margin-right: 10rpx;
 }
@@ -494,8 +507,8 @@ flex-jcc {
 /*伪元素横线  */
 
 .through-line {
-  font-size: 30rpx;
-  color: #333;
+  /* font-size: 30rpx;
+  color: #333; */
   width: 100%;
   height: 100rpx;
 }
@@ -671,31 +684,40 @@ button:after {
 }
 
 .course-name {
-font-size: 30rpx;
-word-break: break-all;/*允许在单词内换行*/
-text-align: left;
-color: #323232;
-line-height: 45rpx;
-text-overflow: -o-ellipsis-lastline;/*css3中webkit内核提供的一个方法类似ellipsis*/
-overflow: hidden;
-text-overflow: ellipsis;
-display: -webkit-box;/*自适应盒子*/
--webkit-line-clamp: 1;/*此处为1行,如果是两行就改成2*/
--webkit-box-orient: vertical;
+  font-size: 30rpx;
+  word-break: break-all; /*允许在单词内换行*/
+  text-align: left;
+  color: #323232;
+  line-height: 45rpx;
+  text-overflow: -o-ellipsis-lastline; /*css3中webkit内核提供的一个方法类似ellipsis*/
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box; /*自适应盒子*/
+  -webkit-line-clamp: 1; /*此处为1行,如果是两行就改成2*/
+  -webkit-box-orient: vertical;
 }
 
 .course-name1 {
-font-size: 30rpx;
-word-break: break-all;/*允许在单词内换行*/
-text-align: left;
-color: #323232;
-line-height: 45rpx;
-text-overflow: -o-ellipsis-lastline;/*css3中webkit内核提供的一个方法类似ellipsis*/
-overflow: hidden;
-text-overflow: ellipsis;
-display: -webkit-box;/*自适应盒子*/
--webkit-line-clamp:2;/*此处为1行,如果是两行就改成2*/
--webkit-box-orient: vertical;
+  font-size: 30rpx;
+  word-break: break-all; /*允许在单词内换行*/
+  text-align: left;
+  color: #323232;
+  line-height: 45rpx;
+  text-overflow: -o-ellipsis-lastline; /*css3中webkit内核提供的一个方法类似ellipsis*/
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box; /*自适应盒子*/
+  -webkit-line-clamp: 2; /*此处为1行,如果是两行就改成2*/
+  -webkit-box-orient: vertical;
+}
+.wxParse-p{
+  width: 100% !important;
+}
+.wxParse-div{
+  width: 100% !important;
+  margin-left: 0 !important;
+  margin-right: 0 !important;
+}
+.wxParse-img{
+  width: 100% !important;
 }
-
-

+ 5 - 5
src/config.js

@@ -1,11 +1,11 @@
-export default {
+export default {
   version: '1.0.0',
-  appName: '囡囡旅行',// 
+  appName: '囡囡旅行', // 
   env: 'prod',
   publicPath: 'https://api3.zowoyoo.com',
   downloadFile: 'https://www.tuanmenpiao.com', // 
-  ParentCustId: '319597',// 
-  appId: '106',// 小程序的编号
+  ParentCustId: '319597', // 
+  appId: '106', // 小程序的编号
   custId: '319597' //
-  
+
 };

BIN
src/img/ball.png


BIN
src/img/fanhui.png


BIN
src/img/icon/10124949Normal.png


BIN
src/img/icon/img_homeNormal.png


BIN
src/img/left.png


BIN
src/img/link1.png


BIN
src/img/link11.png


BIN
src/img/link12.png


BIN
src/img/link3.png


BIN
src/img/link4.png


BIN
src/img/link5.png


BIN
src/img/link6.png


BIN
src/img/link8.png


BIN
src/img/link9.png


BIN
src/img/mark.png


BIN
src/img/right.png


BIN
src/img/star1.png


BIN
src/img/star2.png


BIN
src/img/text_bao.png


src/img/天气图标/IOS/tianqi01@2x.png → src/img/weather/tianqi01@2x.png


src/img/天气图标/IOS/tianqi02@2x.png → src/img/weather/tianqi02@2x.png


src/img/天气图标/IOS/tianqi03@2x.png → src/img/weather/tianqi03@2x.png


src/img/天气图标/IOS/tianqi04@2x.png → src/img/weather/tianqi04@2x.png


src/img/天气图标/IOS/tianqi05@2x.png → src/img/weather/tianqi05@2x.png


BIN
src/img/zhuanfa.png


BIN
src/img/发现icon/IOS/faxian_wx@1x.png


BIN
src/img/发现icon/IOS/faxian_wx@2x.png


BIN
src/img/发现icon/IOS/faxian_xz@1x.png


BIN
src/img/发现icon/IOS/faxian_xz@2x.png


BIN
src/img/天气图标/IOS/tianqi01@1x.png


BIN
src/img/天气图标/IOS/tianqi02@1x.png


BIN
src/img/天气图标/IOS/tianqi02@3x.png


BIN
src/img/天气图标/IOS/tianqi03@1x.png


BIN
src/img/天气图标/IOS/tianqi03@3x.png


BIN
src/img/天气图标/IOS/tianqi04@1x.png


BIN
src/img/天气图标/IOS/tianqi04@3x.png


BIN
src/img/天气图标/IOS/tianqi05@1x.png


BIN
src/img/天气图标/IOS/tianqi05@3x.png


+ 5 - 5
src/pages/activityDetail/activityDetail.js

@@ -73,10 +73,10 @@ Page({
   },
   // 加载详情
   getDetail() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/news/info/'+this.data.id,
       {
         startIndex: 0,
@@ -96,7 +96,7 @@ Page({
           detail: res.data,
           infoTickets: res.data.infoTickets
         })
-        WxParse.wxParse('content', 'html', res.data.content, this, 5);
+        WxParse.wxParse('content', 'html', res.data.content, this, 0);
       })
   },
 })

+ 14 - 12
src/pages/activityDetail/activityDetail.wxml

@@ -1,9 +1,9 @@
 <!--pages/activityDetail/activityDetail.wxml-->
-<import src="../../wxParse/wxParse.wxml"/> 
-<view class='pad20'>
-  <view class='flex flex-column bdb pt20 pb20'>
-    <view class='flex flex-bt'>
-      <view class='f36 c333 bold'>{{detail.title}}</view>
+<import src="../../wxParse/wxParse.wxml" />
+<view class='w100 pad20 b-box'>
+  <view class='flex flex-column bdb pt20 pb20 b-box'>
+    <view class='flex flex-bt b-box w100'>
+      <view class='f36 c333 bold b-box'>{{detail.title}}</view>
       <button open-type='share' hover-class='none'>
         <image src='/img/share.png' style='width:36rpx;height:36rpx;'></image>
       </button>
@@ -11,19 +11,19 @@
     <view class='f28 mt10'>
       <text class='f24 c666'>来自:魔都小囡囡</text>
       <text class='green mr20'>{{detail.name ? detail.name : ''}}</text>
-     <!-- <text class='c666 ml20'>阅读量:</text> -->
+      <!-- <text class='c666 ml20'>阅读量:</text> -->
       <text class='green'>{{detail.click ? detail.click : ''}}</text>
     </view>
 
   </view>
-  <view class='pt20' wx:if='{{infoTickets && infoTickets.length}}'>
+  <view class='pt40 pb40 flex flex-center w100' wx:if='{{infoTickets && infoTickets.length}}'>
     <view class='zs flex flex-center'>
       <image class='zsImg' src='/img/zs.png' style='height:25rpx'></image>
       <text class='f32 orange bold'>活动产品</text> </view>
   </view>
 
 
-  <navigator wx:for='{{infoTickets}}' wx:key='{{index}}' url='/pages/needKnow/needKnow?infoId={{item.infoId}}' hover-class='none' class='flex flex-bt mb20' >
+  <navigator wx:for='{{infoTickets}}' wx:key='{{index}}' url='/pages/needKnow/needKnow?infoId={{item.infoId}}' hover-class='none' class='flex flex-bt mb20'>
     <image src='{{item.signImg}}' style='width:250rpx;height:190rpx;'></image>
     <view class='flex-1 pl20 pr20 pb20 pt20 b-box flex flex-column flex-bt bdt bdr bdb'>
       <view>
@@ -42,10 +42,12 @@
 
   </navigator>
 
-  <view class='mt20 pt20'>
-    <view class='f28' style='color:#717171;line-height:40rpx'>
-      <template is="wxParse" data="{{wxParseData:content.nodes}}"/>
+  <view class='mt20 pt20 w100'>
+    <view class='f28 w100' style='color:#717171;line-height:40rpx'>
+      <template is="wxParse" data="{{wxParseData:content.nodes}}" />
+    </view>
+    <view class='flex flex-center pt20'>
+      <image src='{{detail.img}}' style='width:100%;' mode='widthFix'></image>
     </view>
-    <view class='flex flex-center pt20'><image src='{{detail.img}}' style='width:690rpx;height:300rpx;'></image></view>
   </view>
 </view>

+ 4 - 2
src/pages/activityDetail/activityDetail.wxss

@@ -1,10 +1,12 @@
 /* pages/activityDetail/activityDetail.wxss */
-
+page{
+  /* width: 100%; */
+}
 .zs {
   width: 248rpx;
   height: 25rpx;
   position: relative;
-  margin: 40rpx auto;
+  /* margin: 40rpx auto; */
 }
 
 .zsImg {

+ 150 - 107
src/pages/creatOrder/creatOrder.js

@@ -1,7 +1,13 @@
 // pages/creatOrder/creatOrder.js
-import { shuoAPIClient } from '../../common/api/api.js';
+import {
+  shuoAPIClient
+} from '../../common/api/api.js';
 import user from '../../common/user/user.js';
-import { parseDate } from '../../lib/util/util.js';
+import {
+  parseDate
+} from '../../lib/util/util.js';
+var touchstart = 0
+var touchend = 0
 Page({
 
   /**
@@ -12,7 +18,7 @@ Page({
     curr: "",
     isMoreDate: false, // 日期框展示
     isMask: false,
-    num:1,
+    num: 1,
     choosedData: 1,
     infoId: null,
     year: null,
@@ -88,50 +94,74 @@ Page({
     });
     shuoAPIClient.request('/api/minapp/order/order',
       data, true, 'POST').then(res => {
-        wx.hideLoading()
-        console.log('下单返回', res)
-        if (res.data.state == 2) { // 下单成功,可以立即发起支付
-          let orderId = res.data.orderId
-          wx.requestPayment({
-            'timeStamp': res.data.timestamp,
-            'nonceStr': res.data.noncestr,
-            'package': res.data.packages,
-            'signType': res.data.signtype,
-            'paySign': res.data.paysign,
-            'complete': function (res) {
-              console.log(res, '支付信息')
-              let isPay = res.errMsg.indexOf('fail') > -1 ? 2 : 1;// 支付失败或取消支付:2, 支付成功:1;
-              wx.redirectTo({
-                url: `/pages/orderDetail/orderDetail?orderId=${orderId}&isPay=${isPay}`
-              });
-            }
-          });
-
-        } else if (res.data.state == 1) {
-          let orderId = res.data.orderId
-          wx.redirectTo({
-            url: `/pages/orderDetail/orderDetail?orderId=${orderId}`
-          });
-        } else {
-          wx.showModal({
-            title: '提示',
-            content: res.data.msg,
-            showCancel: false
-          });
-        }
-      })
+      wx.hideLoading()
+      console.log('下单返回', res)
+      if (res.data.state == 2) { // 下单成功,可以立即发起支付
+        let orderId = res.data.orderId
+        wx.requestPayment({
+          'timeStamp': res.data.timestamp,
+          'nonceStr': res.data.noncestr,
+          'package': res.data.packages,
+          'signType': res.data.signtype,
+          'paySign': res.data.paysign,
+          'complete': function(res) {
+            console.log(res, '支付信息')
+            let isPay = res.errMsg.indexOf('fail') > -1 ? 2 : 1; // 支付失败或取消支付:2, 支付成功:1;
+            wx.redirectTo({
+              url: `/pages/orderDetail/orderDetail?orderId=${orderId}&isPay=${isPay}`
+            });
+          }
+        });
+
+      } else if (res.data.state == 1) {
+        let orderId = res.data.orderId
+        wx.redirectTo({
+          url: `/pages/orderDetail/orderDetail?orderId=${orderId}`
+        });
+      } else {
+        wx.showModal({
+          title: '提示',
+          content: res.data.msg,
+          showCancel: false
+        });
+      }
+    })
   },
 
   /**
    * 弹框提示
    */
-  openToast (title, icon) {
+  openToast(title, icon) {
     wx.showToast({
       title: title,
       icon: icon,
       duration: 2000
     })
   },
+
+  touchstart: function(e) {
+    console.log('滑动')
+    console.log(e.changedTouches[0].clientX)
+    touchstart = e.changedTouches[0].clientX
+  },
+  touchend: function(e) {
+    console.log('停止')
+    console.log(e)
+    console.log(e.changedTouches[0].clientX)
+    touchend = e.changedTouches[0].clientX
+    if (touchstart - touchend > 60) {
+      console.log('左滑了')
+      this.nextMonth()
+    }
+    if (touchstart - touchend < -60) {
+      console.log('右滑了')
+      let today = new Date();
+      let amonth = today.getMonth() + 1
+      if (this.data.month > amonth) {
+        this.lastMonth()
+      }
+    }
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -146,20 +176,30 @@ Page({
     })
     this.initDate(this.data.year, this.data.month)
     this.blankDays(this.data.year, this.data.month)
+    this.getProdDetail()
   },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function () {
+  onReady: function() {
 
   },
 
-  onShow: function () {
+  onShow: function(options) {
     console.log('creatOrder')
     this.getPrice()
-    this.getProdDetail()
   },
+  onUnload: function() {
+    console.log('onUnload')
+    if (this.data.linkInfo[0].nameValue || this.data.linkInfo[0].phoneValue || this.data.linkInfo[0].idCardValue) {
+      wx.showToast({
+        title: '你曾经说,最大的愿望,就是去旅行',
+        icon: "none",
+        duration: 2000
+      })
+    }
 
+  },
   /**
    * 初始化日历
    */
@@ -182,7 +222,7 @@ Page({
       // } else if (day + 1 == i) {
       //   dateList.push('明天')
       // } else {
-        dateList.push(i)
+      dateList.push(i)
       // }
     }
     this.setData({
@@ -196,9 +236,9 @@ Page({
   /**
    * 当前月第一日前面的空白格 
    */
-  blankDays(year, month){
+  blankDays(year, month) {
     let date = new Date(year, month - 1, 1)
-    console.log('date', date.getFullYear() + '-' + date.getMonth() + '-' +date.getDate());
+    console.log('date', date.getFullYear() + '-' + date.getMonth() + '-' + date.getDate());
     let week = date.getDay();
     let blankDays = []
     for (let i = 0; i < week; i++) {
@@ -223,7 +263,7 @@ Page({
   /**
    * 非日历内的选中日期事件
    */
-  chooseDate: function (e) {
+  chooseDate: function(e) {
     console.log(e.currentTarget.dataset.traveldate)
     this.setData({
       selectDate: e.currentTarget.dataset.traveldate
@@ -234,7 +274,7 @@ Page({
   /**
    * 数量减少
    */
-  increaseNum: function () {
+  increaseNum: function() {
     let num = this.data.num
     if (num > 1) {
       num--
@@ -249,7 +289,7 @@ Page({
   /**
    * 数量增加
    */
-  addNum: function () {
+  addNum: function() {
     let num = this.data.num
     num++
     this.setData({
@@ -262,7 +302,7 @@ Page({
   /**
    * 价格计算
    */
-  priceCalculation: function () {
+  priceCalculation: function() {
     let num = this.data.num
     let selectDate = this.data.selectDate
     if (!selectDate) {
@@ -278,28 +318,33 @@ Page({
   /**
    * 上个月
    */
-  lastMonth: function () {
-    let year = this.data.year
-    let month = this.data.month
-    if (month == 1) {
-      year = year - 1
-      month = 12
-    } else {
-      month--
+  lastMonth: function() {
+    let today = new Date();
+    let amonth = today.getMonth() + 1
+    if (this.data.month > amonth) {
+      let year = this.data.year
+      let month = this.data.month
+      if (month == 1) {
+        year = year - 1
+        month = 12
+      } else {
+        month--
+      }
+      this.setData({
+        year: year,
+        month: month
+      })
+      this.initDate(year, month)
+      this.blankDays(year, month)
+      this.getPrice()
     }
-    this.setData({
-      year: year,
-      month: month
-    })
-    this.initDate(year, month)
-    this.blankDays(year, month)
-    this.getPrice()
+
   },
 
   /**
    * 下个月
    */
-  nextMonth: function () {
+  nextMonth: function() {
     let year = this.data.year
     let month = this.data.month
     if (month == 12) {
@@ -320,7 +365,7 @@ Page({
   /**
    * 价格日历内选择日期
    */
-  select: function (e) {
+  select: function(e) {
     console.log('select', e.currentTarget.dataset.day)
     let select = e.currentTarget.dataset.day
     let price = this.data.prices[this.data.year + '-' + (this.data.month < 10 ? '0' + this.data.month : this.data.month) + '-' + (select < 10 ? '0' + select : select)]
@@ -332,7 +377,7 @@ Page({
       selectDate: price.travelDate
     })
     this.priceCalculation()
-    
+
 
     let week = new Date().getDay()
     let day = select
@@ -353,7 +398,7 @@ Page({
   /**
    * 价格日历开启
    */
-  tapMoreDate: function () {
+  tapMoreDate: function() {
     this.setData({
       isMoreDate: true,
       isMask: true
@@ -363,13 +408,13 @@ Page({
   /**
    * 价格日历关闭
    */
-  close: function () {
+  close: function() {
     this.setData({
       isMoreDate: false,
       isMask: false
     })
   },
-  
+
   /**
    * 获取价格
    */
@@ -378,36 +423,35 @@ Page({
     //   title: '加载中...',
     //   mask: true
     // });
-    shuoAPIClient.request('/api/minapp/ticket/productPrices',
-      {
-        year: this.data.year,
-        month: this.data.month,
-        infoId: this.data.infoId
-      }, false).then(res => {
-        // wx.hideLoading()
-        let prices = {}
-        console.log('价格', res)
-        if (res.data && res.data) {
-          for (let data of res.data) {
-            prices[data.travelDate] = data
-          }
-          if (!this.data.price3) { //如果前三日价格不存在则加载,存在就不变
-            let price3 = []
-            for (let i = 0; i < 3; i++) {
-              if (res.data[i]) {
-                price3.push(res.data[i])
-              }
+    shuoAPIClient.request('/api/minapp/ticket/productPrices', {
+      year: this.data.year,
+      month: this.data.month,
+      infoId: this.data.infoId
+    }, false).then(res => {
+      // wx.hideLoading()
+      let prices = {}
+      console.log('价格', res)
+      if (res.data && res.data) {
+        for (let data of res.data) {
+          prices[data.travelDate] = data
+        }
+        if (!this.data.price3) { //如果前三日价格不存在则加载,存在就不变
+          let price3 = []
+          for (let i = 0; i < 3; i++) {
+            if (res.data[i]) {
+              price3.push(res.data[i])
             }
-            this.setData({
-              price3: price3
-            })
           }
           this.setData({
-            prices: prices,
+            price3: price3
           })
-          console.log('prices', this.data.prices)
         }
-      })
+        this.setData({
+          prices: prices,
+        })
+        console.log('prices', this.data.prices)
+      }
+    })
   },
 
   /**
@@ -416,21 +460,20 @@ Page({
   getProdDetail() {
     let self = this
     let date = parseDate(new Date())
-    shuoAPIClient.request('/api/minapp/common/product/' + self.data.infoId,
-      {
-        isOrder: 1,
-        travelDate: date.year + '-' + date.month + '-' +date.date
-      }, false).then(res => {
-        console.log('产品详情', res)
-        if (res && res.data) {
-          self.setData({
-            prodDetail: res.data
-          })
-        }
-        this.initLinkInfo()
-      })
+    shuoAPIClient.request('/api/minapp/common/product/' + self.data.infoId, {
+      isOrder: 1,
+      travelDate: date.year + '-' + date.month + '-' + date.date
+    }, false).then(res => {
+      console.log('产品详情', res)
+      if (res && res.data) {
+        self.setData({
+          prodDetail: res.data
+        })
+      }
+      this.initLinkInfo()
+    })
   },
-  
+
   /**
    * 初始取票人信息
    */
@@ -496,7 +539,7 @@ Page({
       })
     }
   },
-  
+
   /**
    * 输入姓名
    */

+ 11 - 11
src/pages/creatOrder/creatOrder.wxml

@@ -10,8 +10,8 @@
       <view wx:if="{{!selectDate}}" class='f24 c666'>请选择日期</view>
       <view wx:else class='f24 c666'>当前选定的日期:{{selectDate}}</view>
     </view>
-    <view class='mt20 mb10 flex flex-bt'>
-      <view wx:for='{{price3}}' wx:key='{{index}}' class='{{selectDate==item.travelDate?"selItem":"item"}} f24 flex flex-column flex-center por' data-travelDate='{{item.travelDate}}' bindtap='chooseDate'>
+    <view class='mt20 mb10 flex'>
+      <view wx:for='{{price3}}' wx:key='{{index}}' class='{{selectDate==item.travelDate?"selItem":"item"}} mr20 f24 flex flex-column flex-center por' data-travelDate='{{item.travelDate}}' bindtap='chooseDate'>
         <view class='c666'>{{item.travelDate}}</view>
         <view class='red mt10 bold'>¥{{item.salePrice / 100}}</view>
         <image src='/img/box.png' style='width:100%;height:100%;top:0;left:0' class='poa' wx:if='{{selectDate==item.travelDate}}'></image>
@@ -36,7 +36,7 @@
   </view>
   <view class='flex flex-start flex-aic pl20 mt20' style='height:52rpx;background:#F6FAFC'>
     <image src='/img/time1.png' style='width:22rpx;height:22rpx;'></image>
-    <view class='f24 green ml10'>每单最多预定{{prodDetail.maxNum == 0 || prodDetail.maxNum == 9999? '无限制' : prodDetail.maxNum + '张'}}</view>
+    <view class='f24 green ml10'>每单最多预定{{prodDetail.maxNum==0||prodDetail.maxNum==9999?'无限制':prodDetail.maxNum+'张'}}</view>
   </view>
 </view>
 
@@ -54,19 +54,19 @@
           </view>
           <text>:</text>
         </view>
-        <input data-index='{{index}}' bindinput='inputName' class='ml20 f28 c333' style='margin-left:24rpx' placeholder='取票人姓名' placeholder-class='f28 c999'></input>
+        <input data-index='{{index}}' bindinput='inputName' class='ml20 f28 c333' style='margin-left:24rpx' placeholder='取票人姓名' placeholder-class='f28 c999' value='{{linkInfo[0].nameValue}}'></input>
       </view>
-      <!-- <navigator url='/pages/selectOwner/selectOwner' hover-class='none'>
+      <navigator url='/pages/selectOwner/selectOwner' hover-class='none'>
         <image src='/img/book.png' style='width:34rpx;height:37rpx;' class='pl20'></image>
-      </navigator> -->
+      </navigator>
     </view>
     <view class='flex flex-aic pt20 pb20 bdb'>
       <view class='f28 c333' style='width:120rpx'>{{item.phone}}:</view>
-      <input data-index='{{index}}' bindinput='inputPhone' class='ml20 f28 c333' placeholder='用于接收确认短信' placeholder-class='f28 c999'></input>
+      <input data-index='{{index}}' bindinput='inputPhone' class='ml20 f28 c333' placeholder='用于接收确认短信' placeholder-class='f28 c999' value='{{linkInfo[0].phoneValue}}'></input>
     </view>
     <view class='flex flex-aic pt20 pb20 bdb' wx:if='{{item.idCard}}'>
       <view class='f28 c333' style='width:120rpx'>{{item.idCard}}:</view>
-      <input type='idcard' data-index='{{index}}' bindinput='inputIdCard' class='ml20 f28 c333' placeholder='用于景区入园凭证' placeholder-class='f28 c999'></input>
+      <input type='idcard' data-index='{{index}}' bindinput='inputIdCard' class='ml20 f28 c333' placeholder='用于景区入园凭证' placeholder-class='f28 c999' value='{{linkInfo[0].idCardValue}}'></input>
     </view>
     
   </view>
@@ -130,10 +130,10 @@
     <view class='{{week==6?"green":""}}'>六</view>
   </view>
 
-  <view class='flex flex-center' style='margin-top:20rpx'>
-    <image src='/img/left.png' style='width:14rpx;height:25rpx;' class='pad20' bindtap='lastMonth'></image>
+  <view class='flex flex-center' style='margin-top:20rpx' bindtouchstart='touchstart' bindtouchend='touchend'>
+    <image src='/img/left.png' mode='widthFix' style='width:28rpx;' class='pad20' bindtap='lastMonth'></image>
     <view class='f28 c666 ml20 mr20'>{{year}}年{{month}}月</view>
-    <image src='/img/right.png' style='width:14rpx;height:25rpx;' class='pad20' bindtap='nextMonth'></image>
+    <image src='/img/right.png' mode='widthFix' style='width:28rpx;' class='pad20' bindtap='nextMonth'></image>
   </view>
 
   <view class='f32 cBA flex flex-wrap'>

+ 148 - 105
src/pages/creatOrder1/creatOrder.js

@@ -1,6 +1,10 @@
 // pages/creatOrder/creatOrder.js
-import { shuoAPIClient } from '../../common/api/api.js';
+import {
+  shuoAPIClient
+} from '../../common/api/api.js';
 import user from '../../common/user/user.js';
+var touchstart = 0
+var touchend = 0
 Page({
 
   /**
@@ -11,7 +15,7 @@ Page({
     curr: "",
     isMoreDate: false, // 日期框展示
     isMask: false,
-    num:1,
+    num: 1,
     choosedData: 1,
     infoId: null,
     year: null,
@@ -87,50 +91,74 @@ Page({
     });
     shuoAPIClient.request('/api/minapp/order/order',
       data, true, 'POST').then(res => {
-        wx.hideLoading()
-        console.log('下单返回', res)
-        if (res.data.state == 2) { // 下单成功,可以立即发起支付
-          let orderId = res.data.orderId
-          wx.requestPayment({
-            'timeStamp': res.data.timestamp,
-            'nonceStr': res.data.noncestr,
-            'package': res.data.packages,
-            'signType': res.data.signtype,
-            'paySign': res.data.paysign,
-            'complete': function (res) {
-              console.log(res, '支付信息')
-              let isPay = res.errMsg.indexOf('fail') > -1 ? 2 : 1;// 支付失败或取消支付:2, 支付成功:1;
-              wx.redirectTo({
-                url: `/pages/orderDetail/orderDetail?orderId=${orderId}&isPay=${isPay}`
-              });
-            }
-          });
-
-        } else if (res.data.state == 1) {
-          let orderId = res.data.orderId
-          wx.redirectTo({
-            url: `/pages/orderDetail/orderDetail?orderId=${orderId}`
-          });
-        } else {
-          wx.showModal({
-            title: '提示',
-            content: res.data.msg,
-            showCancel: false
-          });
-        }
-      })
+      wx.hideLoading()
+      console.log('下单返回', res)
+      if (res.data.state == 2) { // 下单成功,可以立即发起支付
+        let orderId = res.data.orderId
+        wx.requestPayment({
+          'timeStamp': res.data.timestamp,
+          'nonceStr': res.data.noncestr,
+          'package': res.data.packages,
+          'signType': res.data.signtype,
+          'paySign': res.data.paysign,
+          'complete': function(res) {
+            console.log(res, '支付信息')
+            let isPay = res.errMsg.indexOf('fail') > -1 ? 2 : 1; // 支付失败或取消支付:2, 支付成功:1;
+            wx.redirectTo({
+              url: `/pages/orderDetail/orderDetail?orderId=${orderId}&isPay=${isPay}`
+            });
+          }
+        });
+
+      } else if (res.data.state == 1) {
+        let orderId = res.data.orderId
+        wx.redirectTo({
+          url: `/pages/orderDetail/orderDetail?orderId=${orderId}`
+        });
+      } else {
+        wx.showModal({
+          title: '提示',
+          content: res.data.msg,
+          showCancel: false
+        });
+      }
+    })
   },
 
   /**
    * 弹框提示
    */
-  openToast (title, icon) {
+  openToast(title, icon) {
     wx.showToast({
       title: title,
       icon: icon,
       duration: 2000
     })
   },
+
+  touchstart: function(e) {
+    console.log('滑动')
+    console.log(e.changedTouches[0].clientX)
+    touchstart = e.changedTouches[0].clientX
+  },
+  touchend: function(e) {
+    console.log('停止')
+    console.log(e)
+    console.log(e.changedTouches[0].clientX)
+    touchend = e.changedTouches[0].clientX
+    if (touchstart - touchend > 60) {
+      console.log('左滑了')
+      this.nextMonth()
+    }
+    if (touchstart - touchend < -60) {
+      let today = new Date();
+      let amonth = today.getMonth() + 1
+      if (this.data.month > amonth) {
+        this.lastMonth()
+
+      }
+    }
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -145,20 +173,31 @@ Page({
     })
     this.initDate(this.data.year, this.data.month)
     this.blankDays(this.data.year, this.data.month)
+    this.getProdDetail()
   },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function () {
+  onReady: function() {
 
   },
 
-  onShow: function () {
+  onShow: function() {
     console.log('creatOrder')
     this.getPrice()
-    this.getProdDetail()
+    
   },
+  onUnload: function() {
+    console.log('onUnload')
+    if (this.data.linkInfo[0].nameValue || this.data.linkInfo[0].phoneValue || this.data.linkInfo[0].idCardValue) {
+      wx.showToast({
+        title: '你曾经说,最大的愿望,就是去旅行',
+        icon: "none",
+        duration: 2000
+      })
+    }
 
+  },
   /**
    * 初始化日历
    */
@@ -181,7 +220,7 @@ Page({
       // } else if (day + 1 == i) {
       //   dateList.push('明天')
       // } else {
-        dateList.push(i)
+      dateList.push(i)
       // }
     }
     this.setData({
@@ -195,9 +234,9 @@ Page({
   /**
    * 当前月第一日前面的空白格 
    */
-  blankDays(year, month){
+  blankDays(year, month) {
     let date = new Date(year, month - 1, 1)
-    console.log('date', date.getFullYear() + '-' + date.getMonth() + '-' +date.getDate());
+    console.log('date', date.getFullYear() + '-' + date.getMonth() + '-' + date.getDate());
     let week = date.getDay();
     let blankDays = []
     for (let i = 0; i < week; i++) {
@@ -222,7 +261,7 @@ Page({
   /**
    * 非日历内的选中日期事件
    */
-  chooseDate: function (e) {
+  chooseDate: function(e) {
     console.log(e.currentTarget.dataset.traveldate)
     this.setData({
       selectDate: e.currentTarget.dataset.traveldate
@@ -233,7 +272,7 @@ Page({
   /**
    * 数量减少
    */
-  increaseNum: function () {
+  increaseNum: function() {
     let num = this.data.num
     if (num > 1) {
       num--
@@ -248,7 +287,7 @@ Page({
   /**
    * 数量增加
    */
-  addNum: function () {
+  addNum: function() {
     let num = this.data.num
     num++
     this.setData({
@@ -261,7 +300,7 @@ Page({
   /**
    * 价格计算
    */
-  priceCalculation: function () {
+  priceCalculation: function() {
     let num = this.data.num
     let selectDate = this.data.selectDate
     if (!selectDate) {
@@ -277,28 +316,34 @@ Page({
   /**
    * 上个月
    */
-  lastMonth: function () {
-    let year = this.data.year
-    let month = this.data.month
-    if (month == 1) {
-      year = year - 1
-      month = 12
-    } else {
-      month--
+  lastMonth: function() {
+    let today = new Date();
+    let amonth = today.getMonth() + 1
+    if (this.data.month > amonth) {
+      let year = this.data.year
+      let month = this.data.month
+      if (month == 1) {
+        year = year - 1
+        month = 12
+      } else {
+        month--
+      }
+      this.setData({
+        year: year,
+        month: month
+      })
+      this.initDate(year, month)
+      this.blankDays(year, month)
+      this.getPrice()
+
     }
-    this.setData({
-      year: year,
-      month: month
-    })
-    this.initDate(year, month)
-    this.blankDays(year, month)
-    this.getPrice()
+
   },
 
   /**
    * 下个月
    */
-  nextMonth: function () {
+  nextMonth: function() {
     let year = this.data.year
     let month = this.data.month
     if (month == 12) {
@@ -319,7 +364,7 @@ Page({
   /**
    * 价格日历内选择日期
    */
-  select: function (e) {
+  select: function(e) {
     console.log('select', e.currentTarget.dataset.day)
     let select = e.currentTarget.dataset.day
     let price = this.data.prices[this.data.year + '-' + (this.data.month < 10 ? '0' + this.data.month : this.data.month) + '-' + (select < 10 ? '0' + select : select)]
@@ -331,7 +376,7 @@ Page({
       selectDate: price.travelDate
     })
     this.priceCalculation()
-    
+
 
     let week = new Date().getDay()
     let day = select
@@ -352,7 +397,7 @@ Page({
   /**
    * 价格日历开启
    */
-  tapMoreDate: function () {
+  tapMoreDate: function() {
     this.setData({
       isMoreDate: true,
       isMask: true
@@ -362,13 +407,13 @@ Page({
   /**
    * 价格日历关闭
    */
-  close: function () {
+  close: function() {
     this.setData({
       isMoreDate: false,
       isMask: false
     })
   },
-  
+
   /**
    * 获取价格
    */
@@ -377,36 +422,35 @@ Page({
     //   title: '加载中...',
     //   mask: true
     // });
-    shuoAPIClient.request('/api/minapp/ticket/productPrices',
-      {
-        year: this.data.year,
-        month: this.data.month,
-        infoId: this.data.infoId
-      }, false).then(res => {
-        // wx.hideLoading()
-        let prices = {}
-        console.log('价格', res)
-        if (res.data && res.data) {
-          for (let data of res.data) {
-            prices[data.travelDate] = data
-          }
-          if (!this.data.price3) { //如果前三日价格不存在则加载,存在就不变
-            let price3 = []
-            for (let i = 0; i < 3; i++) {
-              if (res.data[i]) {
-                price3.push(res.data[i])
-              }
+    shuoAPIClient.request('/api/minapp/ticket/productPrices', {
+      year: this.data.year,
+      month: this.data.month,
+      infoId: this.data.infoId
+    }, false).then(res => {
+      // wx.hideLoading()
+      let prices = {}
+      console.log('价格', res)
+      if (res.data && res.data) {
+        for (let data of res.data) {
+          prices[data.travelDate] = data
+        }
+        if (!this.data.price3) { //如果前三日价格不存在则加载,存在就不变
+          let price3 = []
+          for (let i = 0; i < 3; i++) {
+            if (res.data[i]) {
+              price3.push(res.data[i])
             }
-            this.setData({
-              price3: price3
-            })
           }
           this.setData({
-            prices: prices,
+            price3: price3
           })
-          console.log('prices', this.data.prices)
         }
-      })
+        this.setData({
+          prices: prices,
+        })
+        console.log('prices', this.data.prices)
+      }
+    })
   },
 
   /**
@@ -414,20 +458,19 @@ Page({
    */
   getProdDetail() {
     let self = this
-    shuoAPIClient.request('/api/minapp/common/product/' + self.data.infoId,
-      {
-        isOrder: 1
-      }, false).then(res => {
-        console.log('产品详情', res)
-        if (res && res.data) {
-          self.setData({
-            prodDetail: res.data
-          })
-        }
-        this.initLinkInfo()
-      })
+    shuoAPIClient.request('/api/minapp/common/product/' + self.data.infoId, {
+      isOrder: 1
+    }, false).then(res => {
+      console.log('产品详情', res)
+      if (res && res.data) {
+        self.setData({
+          prodDetail: res.data
+        })
+      }
+      this.initLinkInfo()
+    })
   },
-  
+
   /**
    * 初始取票人信息
    */
@@ -493,7 +536,7 @@ Page({
       })
     }
   },
-  
+
   /**
    * 输入姓名
    */

+ 10 - 10
src/pages/creatOrder1/creatOrder.wxml

@@ -10,8 +10,8 @@
       <view wx:if="{{!selectDate}}" class='f24 c666'>请选择日期</view>
       <view wx:else class='f24 c666'>当前选定的日期:{{selectDate}}</view>
     </view>
-    <view class='mt20 mb10 flex flex-bt'>
-      <view wx:for='{{price3}}' wx:key='{{index}}' class='{{selectDate==item.travelDate?"selItem":"item"}} f24 flex flex-column flex-center por' data-travelDate='{{item.travelDate}}' bindtap='chooseDate'>
+    <view class='mt20 mb10 flex'>
+      <view wx:for='{{price3}}' wx:key='{{index}}' class='{{selectDate==item.travelDate?"selItem":"item"}} mr20 f24 flex flex-column flex-center por' data-travelDate='{{item.travelDate}}' bindtap='chooseDate'>
         <view class='c666'>{{item.travelDate}}</view>
         <view class='red mt10 bold'>¥{{item.salePrice / 100}}</view>
         <image src='/img/box.png' style='width:100%;height:100%;top:0;left:0' class='poa' wx:if='{{selectDate==item.travelDate}}'></image>
@@ -54,19 +54,19 @@
           </view>
           <text>:</text>
         </view>
-        <input data-index='{{index}}' bindinput='inputName' class='ml20 f28 c333' style='margin-left:24rpx' placeholder='取票人姓名' placeholder-class='f28 c999'></input>
+        <input data-index='{{index}}' bindinput='inputName' class='ml20 f28 c333' style='margin-left:24rpx' placeholder='取票人姓名' placeholder-class='f28 c999' value='{{linkInfo[0].nameValue}}'></input>
       </view>
-      <!-- <navigator url='/pages/selectOwner/selectOwner' hover-class='none'>
+      <navigator url='/pages/selectOwner/selectOwner' hover-class='none'>
         <image src='/img/book.png' style='width:34rpx;height:37rpx;' class='pl20'></image>
-      </navigator> -->
+      </navigator>
     </view>
     <view class='flex flex-aic pt20 pb20 bdb'>
       <view class='f28 c333' style='width:120rpx'>{{item.phone}}:</view>
-      <input data-index='{{index}}' bindinput='inputPhone' class='ml20 f28 c333' placeholder='用于接收确认短信' placeholder-class='f28 c999'></input>
+      <input data-index='{{index}}' bindinput='inputPhone' class='ml20 f28 c333' placeholder='用于接收确认短信' placeholder-class='f28 c999' value='{{linkInfo[0].phoneValue}}'></input>
     </view>
     <view class='flex flex-aic pt20 pb20 bdb' wx:if='{{item.idCard}}'>
       <view class='f28 c333' style='width:120rpx'>{{item.idCard}}:</view>
-      <input type='idcard' data-index='{{index}}' bindinput='inputIdCard' class='ml20 f28 c333' placeholder='用于景区入园凭证' placeholder-class='f28 c999'></input>
+      <input type='idcard' data-index='{{index}}' bindinput='inputIdCard' class='ml20 f28 c333' placeholder='用于景区入园凭证' placeholder-class='f28 c999' value='{{linkInfo[0].idCardValue}}'></input>
     </view>
     
   </view>
@@ -130,10 +130,10 @@
     <view class='{{week==6?"green":""}}'>六</view>
   </view>
 
-  <view class='flex flex-center' style='margin-top:20rpx'>
-    <image src='/img/left.png' style='width:14rpx;height:25rpx;' class='pad20' bindtap='lastMonth'></image>
+  <view class='flex flex-center' style='margin-top:20rpx' bindtouchstart='touchstart' bindtouchend='touchend'>
+    <image src='/img/left.png' mode='widthFix' style='width:28rpx;' class='pad20' bindtap='lastMonth'></image>
     <view class='f28 c666 ml20 mr20'>{{year}}年{{month}}月</view>
-    <image src='/img/right.png' style='width:14rpx;height:25rpx;' class='pad20' bindtap='nextMonth'></image>
+    <image src='/img/right.png' mode='widthFix' style='width:28rpx;' class='pad20' bindtap='nextMonth'></image>
   </view>
 
   <view class='f32 cBA flex flex-wrap'>

+ 157 - 104
src/pages/creatOrder2/creatOrder.js

@@ -1,6 +1,10 @@
 // pages/creatOrder/creatOrder.js
-import { shuoAPIClient } from '../../common/api/api.js';
+import {
+  shuoAPIClient
+} from '../../common/api/api.js';
 import user from '../../common/user/user.js';
+var touchstart = 0
+var touchend = 0
 Page({
 
   /**
@@ -11,7 +15,7 @@ Page({
     curr: "",
     isMoreDate: false, // 日期框展示
     isMask: false,
-    num:1,
+    num: 1,
     choosedData: 1,
     infoId: null,
     year: null,
@@ -87,50 +91,84 @@ Page({
     });
     shuoAPIClient.request('/api/minapp/order/order',
       data, true, 'POST').then(res => {
-        wx.hideLoading()
-        console.log('下单返回', res)
-        if (res.data.state == 2) { // 下单成功,可以立即发起支付
-          let orderId = res.data.orderId
-          wx.requestPayment({
-            'timeStamp': res.data.timestamp,
-            'nonceStr': res.data.noncestr,
-            'package': res.data.packages,
-            'signType': res.data.signtype,
-            'paySign': res.data.paysign,
-            'complete': function (res) {
-              console.log(res, '支付信息')
-              let isPay = res.errMsg.indexOf('fail') > -1 ? 2 : 1;// 支付失败或取消支付:2, 支付成功:1;
-              wx.redirectTo({
-                url: `/pages/orderDetail/orderDetail?orderId=${orderId}&isPay=${isPay}`
-              });
+      wx.hideLoading()
+      console.log('下单返回', res)
+      if (res.data.state == 2) { // 下单成功,可以立即发起支付
+        let orderId = res.data.orderId
+        wx.requestPayment({
+          'timeStamp': res.data.timestamp,
+          'nonceStr': res.data.noncestr,
+          'package': res.data.packages,
+          'signType': res.data.signtype,
+          'paySign': res.data.paysign,
+          'complete': function(res) {
+            console.log(res, '支付信息')
+            let isPay = res.errMsg.indexOf('fail') > -1 ? 2 : 1; // 支付失败或取消支付:2, 支付成功:1;
+            console.log(isPay)
+            if (isPay == 2) {
+              wx.showToast({
+                title: '旅行的理由不需要阐述太多,一个字就可以概括全部:走',
+                icon: "none",
+                duration: 2000
+              })
             }
-          });
-
-        } else if (res.data.state == 1) {
-          let orderId = res.data.orderId
-          wx.redirectTo({
-            url: `/pages/orderDetail/orderDetail?orderId=${orderId}`
-          });
-        } else {
-          wx.showModal({
-            title: '提示',
-            content: res.data.msg,
-            showCancel: false
-          });
-        }
-      })
+            wx.redirectTo({
+              url: `/pages/orderDetail/orderDetail?orderId=${orderId}&isPay=${isPay}`
+            });
+          }
+        });
+
+      } else if (res.data.state == 1) {
+        let orderId = res.data.orderId
+        wx.redirectTo({
+          url: `/pages/orderDetail/orderDetail?orderId=${orderId}`
+        });
+      } else {
+        wx.showModal({
+          title: '提示',
+          content: res.data.msg,
+          showCancel: false
+        });
+      }
+    })
   },
 
   /**
    * 弹框提示
    */
-  openToast (title, icon) {
+  openToast(title, icon) {
     wx.showToast({
       title: title,
       icon: icon,
       duration: 2000
     })
   },
+
+  touchstart: function(e) {
+    console.log('滑动')
+    console.log(e.changedTouches[0].clientX)
+    touchstart = e.changedTouches[0].clientX
+  },
+  touchend: function(e) {
+    console.log('停止')
+    console.log(e)
+    console.log(e.changedTouches[0].clientX)
+    touchend = e.changedTouches[0].clientX
+    if (touchstart - touchend > 60) {
+      console.log('左滑了')
+      this.nextMonth()
+
+    }
+    if (touchstart - touchend < -60) {
+      console.log('右滑了')
+      let today = new Date();
+      let amonth = today.getMonth() + 1
+      if (this.data.month > amonth) {
+        this.lastMonth()
+      }
+
+    }
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -145,20 +183,31 @@ Page({
     })
     this.initDate(this.data.year, this.data.month)
     this.blankDays(this.data.year, this.data.month)
+    this.getProdDetail()
   },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function () {
+  onReady: function() {
 
   },
 
-  onShow: function () {
+  onShow: function() {
     console.log('creatOrder')
     this.getPrice()
-    this.getProdDetail()
   },
 
+  onUnload: function() {
+    console.log('onUnload')
+    if (this.data.linkInfo[0].nameValue || this.data.linkInfo[0].phoneValue || this.data.linkInfo[0].idCardValue) {
+      wx.showToast({
+        title: '你曾经说,最大的愿望,就是去旅行',
+        icon: "none",
+        duration: 2000
+      })
+    }
+
+  },
   /**
    * 初始化日历
    */
@@ -181,7 +230,7 @@ Page({
       // } else if (day + 1 == i) {
       //   dateList.push('明天')
       // } else {
-        dateList.push(i)
+      dateList.push(i)
       // }
     }
     this.setData({
@@ -195,9 +244,9 @@ Page({
   /**
    * 当前月第一日前面的空白格 
    */
-  blankDays(year, month){
+  blankDays(year, month) {
     let date = new Date(year, month - 1, 1)
-    console.log('date', date.getFullYear() + '-' + date.getMonth() + '-' +date.getDate());
+    console.log('date', date.getFullYear() + '-' + date.getMonth() + '-' + date.getDate());
     let week = date.getDay();
     let blankDays = []
     for (let i = 0; i < week; i++) {
@@ -222,7 +271,7 @@ Page({
   /**
    * 非日历内的选中日期事件
    */
-  chooseDate: function (e) {
+  chooseDate: function(e) {
     console.log(e.currentTarget.dataset.traveldate)
     this.setData({
       selectDate: e.currentTarget.dataset.traveldate
@@ -233,7 +282,7 @@ Page({
   /**
    * 数量减少
    */
-  increaseNum: function () {
+  increaseNum: function() {
     let num = this.data.num
     if (num > 1) {
       num--
@@ -248,7 +297,7 @@ Page({
   /**
    * 数量增加
    */
-  addNum: function () {
+  addNum: function() {
     let num = this.data.num
     num++
     this.setData({
@@ -261,7 +310,7 @@ Page({
   /**
    * 价格计算
    */
-  priceCalculation: function () {
+  priceCalculation: function() {
     let num = this.data.num
     let selectDate = this.data.selectDate
     if (!selectDate) {
@@ -277,28 +326,34 @@ Page({
   /**
    * 上个月
    */
-  lastMonth: function () {
-    let year = this.data.year
-    let month = this.data.month
-    if (month == 1) {
-      year = year - 1
-      month = 12
-    } else {
-      month--
+  lastMonth: function() {
+    let today = new Date();
+    let amonth = today.getMonth() + 1
+    if (this.data.month > amonth) {
+      let year = this.data.year
+      let month = this.data.month
+      if (month == 1) {
+        year = year - 1
+        month = 12
+      } else {
+        month--
+      }
+      this.setData({
+        year: year,
+        month: month
+      })
+      this.initDate(year, month)
+      this.blankDays(year, month)
+      this.getPrice()
+
     }
-    this.setData({
-      year: year,
-      month: month
-    })
-    this.initDate(year, month)
-    this.blankDays(year, month)
-    this.getPrice()
+
   },
 
   /**
    * 下个月
    */
-  nextMonth: function () {
+  nextMonth: function() {
     let year = this.data.year
     let month = this.data.month
     if (month == 12) {
@@ -319,7 +374,7 @@ Page({
   /**
    * 价格日历内选择日期
    */
-  select: function (e) {
+  select: function(e) {
     console.log('select', e.currentTarget.dataset.day)
     let select = e.currentTarget.dataset.day
     let price = this.data.prices[this.data.year + '-' + (this.data.month < 10 ? '0' + this.data.month : this.data.month) + '-' + (select < 10 ? '0' + select : select)]
@@ -331,7 +386,7 @@ Page({
       selectDate: price.travelDate
     })
     this.priceCalculation()
-    
+
 
     let week = new Date().getDay()
     let day = select
@@ -352,7 +407,7 @@ Page({
   /**
    * 价格日历开启
    */
-  tapMoreDate: function () {
+  tapMoreDate: function() {
     this.setData({
       isMoreDate: true,
       isMask: true
@@ -362,13 +417,13 @@ Page({
   /**
    * 价格日历关闭
    */
-  close: function () {
+  close: function() {
     this.setData({
       isMoreDate: false,
       isMask: false
     })
   },
-  
+
   /**
    * 获取价格
    */
@@ -377,36 +432,35 @@ Page({
     //   title: '加载中...',
     //   mask: true
     // });
-    shuoAPIClient.request('/api/minapp/ticket/productPrices',
-      {
-        year: this.data.year,
-        month: this.data.month,
-        infoId: this.data.infoId
-      }, false).then(res => {
-        // wx.hideLoading()
-        let prices = {}
-        console.log('价格', res)
-        if (res.data && res.data) {
-          for (let data of res.data) {
-            prices[data.travelDate] = data
-          }
-          if (!this.data.price3) { //如果前三日价格不存在则加载,存在就不变
-            let price3 = []
-            for (let i = 0; i < 3; i++) {
-              if (res.data[i]) {
-                price3.push(res.data[i])
-              }
+    shuoAPIClient.request('/api/minapp/ticket/productPrices', {
+      year: this.data.year,
+      month: this.data.month,
+      infoId: this.data.infoId
+    }, false).then(res => {
+      // wx.hideLoading()
+      let prices = {}
+      console.log('价格', res)
+      if (res.data && res.data) {
+        for (let data of res.data) {
+          prices[data.travelDate] = data
+        }
+        if (!this.data.price3) { //如果前三日价格不存在则加载,存在就不变
+          let price3 = []
+          for (let i = 0; i < 3; i++) {
+            if (res.data[i]) {
+              price3.push(res.data[i])
             }
-            this.setData({
-              price3: price3
-            })
           }
           this.setData({
-            prices: prices,
+            price3: price3
           })
-          console.log('prices', this.data.prices)
         }
-      })
+        this.setData({
+          prices: prices,
+        })
+        console.log('prices', this.data.prices)
+      }
+    })
   },
 
   /**
@@ -414,20 +468,19 @@ Page({
    */
   getProdDetail() {
     let self = this
-    shuoAPIClient.request('/api/minapp/common/product/' + self.data.infoId,
-      {
-        isOrder: 1
-      }, false).then(res => {
-        console.log('产品详情', res)
-        if (res && res.data) {
-          self.setData({
-            prodDetail: res.data
-          })
-        }
-        this.initLinkInfo()
-      })
+    shuoAPIClient.request('/api/minapp/common/product/' + self.data.infoId, {
+      isOrder: 1
+    }, false).then(res => {
+      console.log('产品详情', res)
+      if (res && res.data) {
+        self.setData({
+          prodDetail: res.data
+        })
+      }
+      this.initLinkInfo()
+    })
   },
-  
+
   /**
    * 初始取票人信息
    */
@@ -493,7 +546,7 @@ Page({
       })
     }
   },
-  
+
   /**
    * 输入姓名
    */

+ 10 - 10
src/pages/creatOrder2/creatOrder.wxml

@@ -10,8 +10,8 @@
       <view wx:if="{{!selectDate}}" class='f24 c666'>请选择日期</view>
       <view wx:else class='f24 c666'>当前选定的日期:{{selectDate}}</view>
     </view>
-    <view class='mt20 mb10 flex flex-bt'>
-      <view wx:for='{{price3}}' wx:key='{{index}}' class='{{selectDate==item.travelDate?"selItem":"item"}} f24 flex flex-column flex-center por' data-travelDate='{{item.travelDate}}' bindtap='chooseDate'>
+    <view class='mt20 mb10 flex'>
+      <view wx:for='{{price3}}' wx:key='{{index}}' class='{{selectDate==item.travelDate?"selItem":"item"}} mr20 f24 flex flex-column flex-center por' data-travelDate='{{item.travelDate}}' bindtap='chooseDate'>
         <view class='c666'>{{item.travelDate}}</view>
         <view class='red mt10 bold'>¥{{item.salePrice / 100}}</view>
         <image src='/img/box.png' style='width:100%;height:100%;top:0;left:0' class='poa' wx:if='{{selectDate==item.travelDate}}'></image>
@@ -54,19 +54,19 @@
           </view>
           <text>:</text>
         </view>
-        <input data-index='{{index}}' bindinput='inputName' class='ml20 f28 c333' style='margin-left:24rpx' placeholder='取票人姓名' placeholder-class='f28 c999'></input>
+        <input data-index='{{index}}' bindinput='inputName' class='ml20 f28 c333' style='margin-left:24rpx' placeholder='取票人姓名' placeholder-class='f28 c999' value='{{linkInfo[0].nameValue}}'></input>
       </view>
-      <!-- <navigator url='/pages/selectOwner/selectOwner' hover-class='none'>
+      <navigator url='/pages/selectOwner/selectOwner' hover-class='none'>
         <image src='/img/book.png' style='width:34rpx;height:37rpx;' class='pl20'></image>
-      </navigator> -->
+      </navigator>
     </view>
     <view class='flex flex-aic pt20 pb20 bdb'>
       <view class='f28 c333' style='width:120rpx'>{{item.phone}}:</view>
-      <input data-index='{{index}}' bindinput='inputPhone' class='ml20 f28 c333' placeholder='用于接收确认短信' placeholder-class='f28 c999'></input>
+      <input data-index='{{index}}' bindinput='inputPhone' class='ml20 f28 c333' placeholder='用于接收确认短信' placeholder-class='f28 c999' value='{{linkInfo[0].phoneValue}}'></input>
     </view>
     <view class='flex flex-aic pt20 pb20 bdb' wx:if='{{item.idCard}}'>
       <view class='f28 c333' style='width:120rpx'>{{item.idCard}}:</view>
-      <input type='idcard' data-index='{{index}}' bindinput='inputIdCard' class='ml20 f28 c333' placeholder='用于景区入园凭证' placeholder-class='f28 c999'></input>
+      <input type='idcard' data-index='{{index}}' bindinput='inputIdCard' class='ml20 f28 c333' placeholder='用于景区入园凭证' placeholder-class='f28 c999' value='{{linkInfo[0].idCardValue}}'></input>
     </view>
     
   </view>
@@ -130,10 +130,10 @@
     <view class='{{week==6?"green":""}}'>六</view>
   </view>
 
-  <view class='flex flex-center' style='margin-top:20rpx'>
-    <image src='/img/left.png' style='width:14rpx;height:25rpx;' class='pad20' bindtap='lastMonth'></image>
+  <view class='flex flex-center' style='margin-top:20rpx' bindtouchstart='touchstart' bindtouchend='touchend'>
+    <image src='/img/left.png' mode='widthFix' style='width:28rpx;' class='pad20' bindtap='lastMonth'></image>
     <view class='f28 c666 ml20 mr20'>{{year}}年{{month}}月</view>
-    <image src='/img/right.png' style='width:14rpx;height:25rpx;' class='pad20' bindtap='nextMonth'></image>
+    <image src='/img/right.png' mode='widthFix' style='width:28rpx;' class='pad20' bindtap='nextMonth'></image>
   </view>
 
   <view class='f32 cBA flex flex-wrap'>

+ 4 - 4
src/pages/flashSale/index.js

@@ -78,10 +78,10 @@ Page({
 
   //获取城市
   getAreas() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/common/areas',
       {
         areaType: 0, //周边地区

+ 4 - 4
src/pages/freeGo/index.js

@@ -79,10 +79,10 @@ Page({
 
   //获取城市
   getAreas() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/common/areas',
       {
         areaType: 0, //周边地区

+ 12 - 8
src/pages/huiTravel/index.js

@@ -51,19 +51,19 @@ Page({
       }, false).then(res => {
         wx.hideLoading()
         console.log('营销内容', res)
-        if (res.data.results && res.data.results.length) {
-          for (let data of res.data.results) {
-            data.createDate = data.createDate.substring(0, data.createDate.length - 2)
+        if (res.data.results.length>0) {
+          for (let o of res.data.results) {
+            o.createDate = o.createDate.substring(0, o.createDate.length - 2)
           }
-          let datas = this.data.infos
-          datas.push(...res.data.results)
+          let list = [...this.data.infos,...res.data.results]
+          // list.push(...res.data.results)
+
           let isAll = 0
-          if (res.data.sizeAll == datas.length) {
+          if (res.data.sizeAll == list.length) {
             isAll = 1
           }
           this.setData({
-            infos: datas,
-            page: this.data.page + 1,
+            infos: list,
             isAll,
             lock: false
           })
@@ -81,6 +81,7 @@ Page({
  * 请求数据重置
  */
   restoreData() {
+    console.log('1')
     this.setData({
       page: 0,
       isAll: 0,
@@ -136,6 +137,9 @@ Page({
   onReachBottom: function() {
     console.log('onReachBottom')
     if (!this.data.lock && this.data.isAll == 0) {
+      this.setData({
+        page: this.data.page + 1
+      })
       this.getInfos()
     }
   },

+ 1 - 0
src/pages/huiTravel/index.wxml

@@ -33,4 +33,5 @@
     </view>
   </view>
 </view>
+
 <backtotop floorstatus='{{floorstatus}}'></backtotop>

+ 175 - 177
src/pages/index/index.js

@@ -1,5 +1,9 @@
-import { shuoAPIClient } from '../../common/api/api.js';
-import { parseDate } from '../../lib/util/util.js';
+import {
+  shuoAPIClient
+} from '../../common/api/api.js';
+import {
+  parseDate
+} from '../../lib/util/util.js';
 var bmap = require('../../lib/util/bmap-wx.min.js');
 //index.js
 //获取应用实例
@@ -36,7 +40,7 @@ Page({
       duration: 300
     })
   },
-  onLoad: function () {
+  onLoad: function() {
     this.getWeather()
   },
   onShow(option) {
@@ -46,7 +50,7 @@ Page({
   },
 
   // 获取滚动条当前位置
-  onPageScroll: function (e) {
+  onPageScroll: function(e) {
     console.log(e)
     if (e.scrollTop > 100) {
       this.setData({
@@ -67,24 +71,24 @@ Page({
     // 新建百度地图对象 
     var BMap = new bmap.BMapWX({
       ak: '6aRTW16sZP3qEwanrMyQOU3xi2awXWIV'
-    }); 
+    });
     BMap.weather({
-      fail: function (data) {
+      fail: function(data) {
 
       },
-      success: function (data) {
+      success: function(data) {
         console.log('getWeather', data)
         if (data && data.originalData && data.originalData.results && data.originalData.results[0].weather_data && data.originalData.results[0].weather_data.length > 1) {
           let weatherData = data.originalData.results[0].weather_data[1]
           let weather = weatherData.weather
           if (weather.indexOf('多云') != -1) {
-            weatherData.dayPictureUrl = '/img/天气图标/IOS/tianqi01@2x.png'
+            weatherData.dayPictureUrl = '/img/weather/tianqi01@2x.png'
           } else if (weather.indexOf('晴') != -1) {
-            weatherData.dayPictureUrl = '/img/天气图标/IOS/tianqi05@2x.png'
+            weatherData.dayPictureUrl = '/img/weather/tianqi05@2x.png'
           } else if (weather.indexOf('雨') != -1) {
-            weatherData.dayPictureUrl = '/img/天气图标/IOS/tianqi03@2x.png'
+            weatherData.dayPictureUrl = '/img/weather/tianqi03@2x.png'
           } else if (weather.indexOf('阴') != -1) {
-            weatherData.dayPictureUrl = '/img/天气图标/IOS/tianqi02@2x.png'
+            weatherData.dayPictureUrl = '/img/weather/tianqi02@2x.png'
           }
           that.setData({
             weather: weatherData
@@ -92,7 +96,7 @@ Page({
           console.log('that.data.weather', that.data.weather)
         }
       }
-    }); 
+    });
   },
 
   /**
@@ -116,75 +120,73 @@ Page({
 
   //获取主题
   getThemes() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
-    shuoAPIClient.request('/api/minapp/ticket/themes',
-      {
-        startIndex: 0,
-        resultNum: 5
-      }, false).then(res => {
-        wx.hideLoading()
-        console.log('主题', res)
-        if (res.data.results && res.data.results.length) {
-          let themes = res.data.results
-          let themesDatas = []
-          for (let theme of themes) {
-            if (theme.catName == '迪士尼') {
-              themesDatas[0] = theme
-            } else if (theme.catName == '门票') {
-              themesDatas[1] = theme
-            } else if (theme.catName == '自由行') {
-              themesDatas[2] = theme
-            } else if (theme.catName == '亲子酒店') {
-              themesDatas[3] = theme
-            } else if (theme.catName == '演出展览') {
-              themesDatas[4] = theme
-            } else {
-              themesDatas.push(theme)
-            }
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
+    shuoAPIClient.request('/api/minapp/ticket/themes', {
+      startIndex: 0,
+      resultNum: 5
+    }, false).then(res => {
+      wx.hideLoading()
+      console.log('主题', res)
+      if (res.data.results && res.data.results.length) {
+        let themes = res.data.results
+        let themesDatas = []
+        for (let theme of themes) {
+          if (theme.catName == '迪士尼') {
+            themesDatas[0] = theme
+          } else if (theme.catName == '门票') {
+            themesDatas[1] = theme
+          } else if (theme.catName == '自由行') {
+            themesDatas[2] = theme
+          } else if (theme.catName == '亲子酒店') {
+            themesDatas[3] = theme
+          } else if (theme.catName == '演出展览') {
+            themesDatas[4] = theme
+          } else {
+            themesDatas.push(theme)
           }
-          let selectedTheme = themesDatas[1].catId
-          this.setData({
-            themesDatas,
-            selectedTheme
-          })
-          //更新景点
-          this.getViews()
         }
-      })
+        let selectedTheme = themesDatas[1].catId
+        this.setData({
+          themesDatas,
+          selectedTheme
+        })
+        //更新景点
+        this.getViews()
+      }
+    })
   },
   //获取城市
   getAreas() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
-    shuoAPIClient.request('/api/minapp/common/areas',
-      {
-        areaType: 0, //周边地区
-        treeId: 0
-      }, false).then(res => {
-        wx.hideLoading()
-        console.log('城市', res)
-        if (res.data && res.data) {
-          let currentRegion = wx.getStorageSync('currentRegion')
-          let region = wx.getStorageSync('region')
-          let selectedArea = wx.getStorageSync('selectedArea')
-          console.log(currentRegion, region, selectedArea)
-          this.setData({
-            areas: res.data,
-            currentRegion: currentRegion ? currentRegion : res.data[0].areaName,
-            region: region ? region : 0,
-            selectedArea: selectedArea ? selectedArea : res.data[0].areaId
-          })
-          //更新限时特惠
-          this.getSpecialProduct(res.data[0].areaId)
-          //更新资讯播报
-          this.getInformations(res.data[0].areaId);
-        }
-      })
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
+    shuoAPIClient.request('/api/minapp/common/areas', {
+      areaType: 0, //周边地区
+      treeId: 0
+    }, false).then(res => {
+      wx.hideLoading()
+      console.log('城市', res)
+      if (res.data && res.data) {
+        let currentRegion = wx.getStorageSync('currentRegion')
+        let region = wx.getStorageSync('region')
+        let selectedArea = wx.getStorageSync('selectedArea')
+        console.log(currentRegion, region, selectedArea)
+        this.setData({
+          areas: res.data,
+          currentRegion: currentRegion ? currentRegion : res.data[0].areaName,
+          region: region ? region : 0,
+          selectedArea: selectedArea ? selectedArea : res.data[0].areaId
+        })
+        //更新限时特惠
+        this.getSpecialProduct(res.data[0].areaId)
+        //更新资讯播报
+        this.getInformations(res.data[0].areaId);
+      }
+    })
   },
   //限时特惠
   getSpecialProduct(areaId) {
@@ -195,77 +197,75 @@ Page({
       areaId = ''
     }
     console.log('areaId', areaId)
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     let date = parseDate(new Date())
-    shuoAPIClient.request('/api/minapp/ticket/products',
-      {
-        areaId,
-        orderBy: 3,//推荐值至高向低排序
-        rushBuy: 1,
-        themeId: 101038,
-        travelDate: date.year + '-' + date.month + '-' + date.date,
-        startIndex: 0,
-        resultNum: 10
-      }, false).then(res => {
-        wx.hideLoading()
-        console.log('限时特惠', res)
+    shuoAPIClient.request('/api/minapp/ticket/products', {
+      areaId,
+      orderBy: 3, //推荐值至高向低排序
+      rushBuy: 1,
+      themeId: 101038,
+      travelDate: date.year + '-' + date.month + '-' + date.date,
+      startIndex: 0,
+      resultNum: 10
+    }, false).then(res => {
+      wx.hideLoading()
+      console.log('限时特惠', res)
+      this.setData({
+        current: 0,
+        specialProducts: []
+      })
+      if (res.data.results && res.data.results.length) {
+        let datas = res.data.results
+        for (let data of datas) {
+          data.startTime = Math.floor(data.startTime / 60)
+          // data.infoTitle = data.infoTitle.length > 16 ? data.infoTitle.substring(0, 16) + '...' : data.infoTitle
+        }
+        let result = []
+        for (var i = 0, len = datas.length; i < len; i += 2) {
+          result.push(datas.slice(i, i + 2));
+        }
+        console.log('限时特惠result', result)
         this.setData({
-          current: 0,
-          specialProducts: []
+          specialProducts: result
         })
-        if (res.data.results && res.data.results.length) {
-          let datas = res.data.results
-          for (let data of datas) {
-            data.startTime = Math.floor(data.startTime / 60)
-            data.infoTitle = data.infoTitle.length > 16 ? data.infoTitle.substring(0, 16) + '...' : data.infoTitle
-          }
-          let result = []
-          for (var i = 0, len = datas.length; i < len; i += 2) {
-            result.push(datas.slice(i, i + 2));
-          }
-          console.log('限时特惠result', result)
-          this.setData({
-            specialProducts: result
-          })
-        }
-      })
+      }
+    })
   },
-  
+
   //猜你喜欢(景点)
   getViews() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
-    shuoAPIClient.request('/api/minapp/ticket/views',
-      {
-        themeId: this.data.selectedTheme,
-        areaId: this.data.selectedArea,
-        startIndex: 0,
-        resultNum: 20
-      }, false).then(res => {
-        wx.hideLoading()
-        console.log('景点', res)
-        if (res.data.results && res.data.results.length) {
-          let datas = res.data.results
-          //分割成两个景点一组
-          var result = [];
-          for (var i = 0, len = datas.length; i < len; i += 2) {
-            result.push(datas.slice(i, i + 2));
-          }
-          console.log(result)
-          this.setData({
-            views: result
-          })
-        } else {
-          this.setData({
-            views: null
-          })
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
+    shuoAPIClient.request('/api/minapp/ticket/views', {
+      themeId: this.data.selectedTheme,
+      areaId: this.data.selectedArea,
+      startIndex: 0,
+      resultNum: 20
+    }, false).then(res => {
+      wx.hideLoading()
+      console.log('景点', res)
+      if (res.data.results && res.data.results.length) {
+        let datas = res.data.results
+        //分割成两个景点一组
+        var result = [];
+        for (var i = 0, len = datas.length; i < len; i += 2) {
+          result.push(datas.slice(i, i + 2));
         }
-      })
+        console.log(result)
+        this.setData({
+          views: result
+        })
+      } else {
+        this.setData({
+          views: null
+        })
+      }
+    })
   },
 
   //获取资讯播报
@@ -273,45 +273,43 @@ Page({
     if (!areaId || areaId == '0') {
       areaId = ''
     }
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
-    shuoAPIClient.request('/api/minapp/news/informationList',
-      {
-        areaId,
-        startIndex: 0, 
-        resultNum: 5
-      }, false).then(res => {
-        wx.hideLoading()
-        console.log('资讯播报', res)
-        if (res.data && res.data) {
-          this.setData({
-            informations: res.data
-          })
-        }
-      })
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
+    shuoAPIClient.request('/api/minapp/news/informationList', {
+      areaId,
+      startIndex: 0,
+      resultNum: 5
+    }, false).then(res => {
+      wx.hideLoading()
+      console.log('资讯播报', res)
+      if (res.data && res.data) {
+        this.setData({
+          informations: res.data
+        })
+      }
+    })
   },
 
   //获取营销内容
   getInfos() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
-    shuoAPIClient.request('/api/minapp/news/infos',
-      {
-        page: 0,
-        resultNum: 5
-      }, false).then(res => {
-        wx.hideLoading()
-        console.log('营销内容', res)
-        if (res.data.results && res.data.results.length) {
-          this.setData({
-            infos: res.data.results
-          })
-        }
-      })
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
+    shuoAPIClient.request('/api/minapp/news/infos', {
+      page: 0,
+      resultNum: 5
+    }, false).then(res => {
+      wx.hideLoading()
+      console.log('营销内容', res)
+      if (res.data.results && res.data.results.length) {
+        this.setData({
+          infos: res.data.results
+        })
+      }
+    })
   },
 
   //修改城市之后的回调
@@ -350,9 +348,9 @@ Page({
   },
 
   //搜索框事件
-  bindSearch: function(e){
+  bindSearch: function(e) {
     console.log(e)
-    wx.navigateTo({    //保留当前页面,跳转到应用内的某个页面(最多打开5个页面,之后按钮就没有响应的)
+    wx.navigateTo({ //保留当前页面,跳转到应用内的某个页面(最多打开5个页面,之后按钮就没有响应的)
       url: "/pages/menpiao/index?keyword=" + e.detail.value
     })
   }

+ 44 - 44
src/pages/index/index.wxml

@@ -12,10 +12,10 @@
       </swiper-item>
     </block>
   </swiper>
-  <view class="nav_dots">  
-      <block wx:for="{{informations}}" wx:key="{{index}}">  
-          <view class="nav_dot{{index == imgCurrent ? ' nav_active' : ''}}"></view>  
-      </block>  
+  <view class="nav_dots">
+    <block wx:for="{{informations}}" wx:key="{{index}}">
+      <view class="nav_dot{{index == imgCurrent ? ' nav_active' : ''}}"></view>
+    </block>
   </view>
 </view>
 <view class='searchView flex flex-aic pad10 pt20 pb20 b-box'>
@@ -34,37 +34,37 @@
 
 
 <view class='mt40 flex bgfff'>
-  <navigator class="flex flex-center flex-1 flex-column" hover-class="none" open-type="navigate"   url="/pages/menpiao/index?themeId=101034&themeName=迪士尼">
-<image src="/img/icon/1.png" style="width:43px;height:43px"></image>
-<view class="f26 c666 mt20">迪士尼</view>
-</navigator>
-<navigator class="flex flex-center flex-1 flex-column" hover-class="none" open-type="navigate" url="/pages/menpiao/index?themeId=101028&themeName=门票">
-<image src="/img/icon/2.png" style="width:43px;height:43px"></image>
-<view class="f26 c666 mt20">门票</view>
-</navigator>
-<navigator class="flex flex-center flex-1 flex-column" hover-class="none" open-type="navigate" url="/pages/freeGo/index?themeId=100827&themeName=自由行">
-<image src="/img/icon/3.png" style="width:43px;height:43px"></image>
-<view class="f26 c666 mt20">自由行</view>
-</navigator>
-<navigator class="flex flex-center flex-1 flex-column" hover-class="none" open-type="navigate" url="/pages/jiudian/index?themeId=101035&themeName=亲子酒店">
-<image src="/img/icon/4.png" style="width:43px;height:43px"></image>
-<view class="f26 c666 mt20">亲子酒店</view>
-</navigator>
-<navigator class="flex flex-center flex-1 flex-column" hover-class="none" open-type="navigate" url="/pages/freeGo/index?themeId=101036&themeName=演出展览">
-<image src="/img/icon/5.png" style="width:43px;height:43px"></image>
-<view class="f26 c666 mt20">演出展览</view>
-</navigator>
+  <navigator class="flex flex-center flex-1 flex-column" hover-class="none" open-type="navigate" url="/pages/link/link?themeId=101034&themeName=迪士尼">
+    <image src="/img/icon/1.png" style="width:43px;height:43px"></image>
+    <view class="f26 c666 mt20">迪士尼</view>
+  </navigator>
+  <navigator class="flex flex-center flex-1 flex-column" hover-class="none" open-type="navigate" url="/pages/menpiao/index?themeId=101028&themeName=门票">
+    <image src="/img/icon/2.png" style="width:43px;height:43px"></image>
+    <view class="f26 c666 mt20">门票</view>
+  </navigator>
+  <navigator class="flex flex-center flex-1 flex-column" hover-class="none" open-type="navigate" url="/pages/freeGo/index?themeId=100827&themeName=自由行">
+    <image src="/img/icon/3.png" style="width:43px;height:43px"></image>
+    <view class="f26 c666 mt20">自由行</view>
+  </navigator>
+  <navigator class="flex flex-center flex-1 flex-column" hover-class="none" open-type="navigate" url="/pages/jiudian/index?themeId=101035&themeName=亲子酒店">
+    <image src="/img/icon/4.png" style="width:43px;height:43px"></image>
+    <view class="f26 c666 mt20">亲子酒店</view>
+  </navigator>
+  <navigator class="flex flex-center flex-1 flex-column" hover-class="none" open-type="navigate" url="/pages/freeGo/index?themeId=101036&themeName=演出展览">
+    <image src="/img/icon/5.png" style="width:43px;height:43px"></image>
+    <view class="f26 c666 mt20">演出展览</view>
+  </navigator>
 </view>
 <view class="headline">
   <image src="/img/icon/img_toutiaoNormal.png" style='width:125rpx;height:30rpx'></image>
   <swiper class="swiper-height2" vertical="true" indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
     <swiper-item wx:for="{{infos}}" wx:key='{{index}}' class='headline_item'>
       <view class='middleTips flex flex-aic pad20 b-box flex-bt'>
-              <view class='flex flex-aic'>
-                
-                <view class='ml20 f28 c222 pr10 headline_title course-name'>{{item.title}}</view>
-              </view>
-              <navigator open-type='navigate' hover-class='none' url="/pages/activityDetail/activityDetail?id={{item.id}}" class='f26 ttcheck' style='color:#079E61;padding-left:20rpx;border-left:2rpx #979797 solid'>查看</navigator>
+        <view class='flex flex-aic'>
+
+          <view class='ml20 f28 c222 pr10 headline_title course-name'>{{item.title}}</view>
+        </view>
+        <navigator open-type='navigate' hover-class='none' url="/pages/activityDetail/activityDetail?id={{item.id}}" class='f26 ttcheck' style='color:#079E61;padding-left:20rpx;border-left:2rpx #979797 solid'>查看</navigator>
       </view>
     </swiper-item>
   </swiper>
@@ -82,7 +82,7 @@
     <block>
       <swiper-item wx:for='{{specialProducts}}' wx:key='{{index}}'>
         <view class='mt20 flex flex-center flex-bt' style='width:93%;padding-left:4%'>
-          <navigator wx:for='{{item}}' wx:key='{{item.infoId}}' hover-class='none'  url="/pages/reverse/index?infoId={{item.infoId}}&stock={{item.stock}}" class='flex flex-center flex-column flex-1 mr10'>
+          <navigator wx:for='{{item}}' wx:key='{{item.infoId}}' hover-class='none' url="/pages/reverse/index?infoId={{item.infoId}}&stock={{item.stock}}" class='flex flex-center flex-column flex-1 mr10'>
             <view class='w100 imgBox' style='height:238rpx'>
               <image src="{{item.signImg}}" style='border-radius:8rpx;width:100%;height:238rpx'></image>
               <view class='topImgTip f20 flex flex-center plr10'>
@@ -90,22 +90,22 @@
                 <view class='bdr' style='padding-right:10rpx'>{{item.city}}
                 </view>
                 <view class="ml10">{{item.peoples ? item.peoples : ''}}</view>
-                </view>
+              </view>
             </view>
-            <view class='flex flex-aic mt20 flex-ais w100' wx:if='{{(item.nowDate < item.orderEndDate)||(item.nowDate > item.orderStartDate&& item.stock>0)}}'>
-              <view class='f24 flex flex-aic' style='color:#717171'>
-                <image src="/img/icon/nz.png" style='width:32rpx;height:32rpx;margin-right:4rpx'></image> 距{{item.orderStartDate > item.nowDate ? '开抢' : '结束'}}:</view>
-                <countdown wx:if="{{item.nowDate > item.orderStartDate}}" startTime='{{item.nowDate}}' endTime='{{item.orderEndDate}}' dayEmpty='{{false}}'></countdown>
-               <countdown wx:else startTime='{{item.nowDate}}' endTime='{{item.orderStartDate}}' dayEmpty='{{false}}'></countdown>
+            <view class='flex flex-aic mt20 flex-ais w100 flex-bt' wx:if='{{(item.nowDate < item.orderEndDate)||(item.nowDate > item.orderStartDate&& item.stock>0)}}'>
+              <view class='f24 flex flex-aic mr5' style='color:#717171'>
+                <image src="/img/icon/nz.png" style='width:28rpx;height:28rpx;margin-right:4rpx'></image>
+                <text>距{{item.orderStartDate > item.nowDate ? '开抢' : '结束'}}:</text> </view>
+              <countdown wx:if="{{item.nowDate > item.orderStartDate}}" startTime='{{item.nowDate}}' endTime='{{item.orderEndDate}}' dayEmpty='{{false}}'></countdown>
+              <countdown wx:else startTime='{{item.nowDate}}' endTime='{{item.orderStartDate}}' dayEmpty='{{false}}'></countdown>
             </view>
             <view class='flex flex-aic mt20 flex-ais w100' wx:else>
               <view class='f24 flex flex-aic' style='color:#717171'>售罄</view>
             </view>
-            <view class='mt20 c333 bold flex flex-ais w100 course-name1 mh ' style=''>
-             {{item.infoTitle}}
+            <view class='mt20 c333 bold flex flex-ais w100 f30 mh mell' style=''>{{item.infoTitle}}
             </view>
             <view class='mt20 c333  flex flex-aic flex-jcc  w100'>
-              <view class='mt10 f28 ' style='color:#FF0000'>¥</view> 
+              <view class='mt10 f28 ' style='color:#FF0000'>¥</view>
               <view class='f36 bold' style='color:#FF0000'>{{item.salePrice / 100}}</view>
               <view class='mt10 f24 ml10' style='color:#9B9B9B'>起</view>
               <view class='mt10 f24 oriPrice' style='color:#9B9B9B'>¥{{item.marketPrice / 100}}</view>
@@ -115,11 +115,11 @@
       </swiper-item>
     </block>
   </swiper>
-  <view class="dots">  
-      <block wx:for="{{specialProducts}}"  wx:key="{{index}}">  
-          <view class="dot{{index == current ? ' active' : ''}}"></view>  
-      </block>  
-  </view>  
+  <view class="dots">
+    <block wx:for="{{specialProducts}}" wx:key="{{index}}">
+      <view class="dot{{index == current ? ' active' : ''}}"></view>
+    </block>
+  </view>
 </view>
 
 <view class='greyBar'></view>

+ 5 - 1
src/pages/index/index.wxss

@@ -203,6 +203,7 @@
 .ttcheck{
   height: 26rpx;
   line-height: 26rpx;
+  width:60rpx;
 }
 
 
@@ -231,4 +232,7 @@
   height: 10rpx;
   border-radius: 8rpx;
   background: #fff;
-}  
+}  
+.headline_title{
+  width: 100%;
+}

+ 12 - 9
src/pages/jiudian/index.js

@@ -96,10 +96,10 @@ Page({
 
   //获取城市
   getAreas() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/common/areas',
       {
         areaType: 0, //周边地区
@@ -170,10 +170,10 @@ Page({
     }
     let themeId = this.data.themeId
     console.log('areaId', areaId)
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/ticket/products',
       {
         areaId,
@@ -291,7 +291,10 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function() {
-
+    console.log('scrolltolower')
+    if (!this.data.viewLock && this.data.isAll == 0) {
+      this.getViews()
+    }
   },
 
   /**

+ 47 - 13
src/pages/jiudian/index.wxml

@@ -40,11 +40,11 @@
       </swiper-item>
     </block>
   </swiper>
-  <view class="dots">  
-      <block wx:for="{{products}}">  
-          <view class="dot{{index == current ? ' active' : ''}}"></view>  
-      </block>  
-  </view>  
+  <view class="dots">
+    <block wx:for="{{products}}">
+      <view class="dot{{index == current ? ' active' : ''}}"></view>
+    </block>
+  </view>
 </view>
 
 <view class='greyBar mt20'></view>
@@ -53,16 +53,16 @@
   <view class='flex flex-center flex-1'>目的地
     <image class='ml10' src="/img/xl.png" style='width:20rpx;height:20rpx'></image>
   </view>
-  <navigator open-type='navigate'  hover-class='none' url='/pages/activityDetail/activityDetail?id=1051' >
-  <view class='flex flex-center flex-1'>可订今日  
-  </view>
+  <navigator open-type='navigate' hover-class='none' url='/pages/activityDetail/activityDetail?id=1051'>
+    <view class='flex flex-center flex-1'>可订今日
+    </view>
   </navigator>
   <view class='flex flex-center flex-1'>默认排序
     <image class='ml10' src="/img/xl.png" style='width:20rpx;height:20rpx'></image>
   </view>
 </view>
 
-<scroll-view scroll-y='{{true}}' style='height:1090rpx' bindscrolltolower='scrolltolower'>
+<!-- <scroll-view scroll-y='{{true}}' style='height:1090rpx' bindscrolltolower='scrolltolower'>
   <view class='listItem pad40 b-box flex bdb' wx:for='{{views}}' wx:key='{{item.viewId}}' data-viewId='{{item.viewId}}' bindtap='openViewDetail'>
     <image src="{{item.signImg}}" style='width:280rpx;height:200rpx;border-radius:10rpx;'></image>
     <view class='flex flex-column ml20 flex-bt'>
@@ -84,10 +84,46 @@
           <view class='cred f36 bold'>{{item.minPrice / 100}}</view>
           <view class='mt10 f24 c333 ml10' style='color:#9B9B9B'>起</view>
         </view>
-        <!-- <view class='f24' style='color:#717171'>距我1.75km</view> -->
       </view>
     </view>
   </view>
+  <view class='listItem pad40 b-box flex' wx:if='{{isAll == 0}}'>
+    <view class='flex flex-center flex-1 loading'>
+      <loading></loading>
+    </view>
+  </view>
+  <view class='listItem pad40 b-box flex' wx:elif='{{isAll == 2}}'>
+    <view class='flex flex-center flex-1 loading'>
+      暂无数据
+    </view>
+  </view>
+</scroll-view> -->
+
+<view class='listItem pad40 b-box flex bdb' wx:for='{{views}}' wx:key='{{item.viewId}}' data-viewId='{{item.viewId}}' bindtap='openViewDetail'>
+  <image src="{{item.signImg}}" style='width:280rpx;height:200rpx;border-radius:10rpx;'></image>
+  <view class='flex flex-column ml20 flex-bt'>
+    <view>
+      <view class='f32 c333 bold'>{{item.viewName}}</view>
+      <view class='flex mt10'>
+        <view class='tip flex flex-center'>{{item.startDay == 0 ? '今日可订' : '提前' + item.startDay + '天订'}}</view>
+        <view class='tip flex flex-center ml10'>闪电确认</view>
+        <view class='tip flex flex-center ml10'>放心入住</view>
+      </view>
+      <view class='flex mt10 flex-aic'>
+        <view class='f26 bdr pr10' style='color:#FB8E00'>4.9分 很好 </view>
+        <view class='c666 f26 ml10'> 已销售3000+笔</view>
+      </view>
+    </view>
+    <view class='flex flex-aic flex-bt'>
+      <view class='flex flex-aic'>
+        <view class='mt10 f28 cred '>¥</view>
+        <view class='cred f36 bold'>{{item.minPrice / 100}}</view>
+        <view class='mt10 f24 c333 ml10' style='color:#9B9B9B'>起</view>
+      </view>
+      <!-- <view class='f24' style='color:#717171'>距我1.75km</view> -->
+    </view>
+  </view>
+</view>
 <view class='listItem pad40 b-box flex' wx:if='{{isAll == 0}}'>
   <view class='flex flex-center flex-1 loading'>
     <loading></loading>
@@ -98,6 +134,4 @@
     暂无数据
   </view>
 </view>
-</scroll-view>
-<backtotop floorstatus='{{floorstatus}}'></backtotop>
-
+<backtotop floorstatus='{{floorstatus}}'></backtotop>

+ 26 - 15
src/pages/jiudian/index.wxss

@@ -21,6 +21,11 @@
 
 .sortBox {
   height: 120rpx;
+  position: -webkit-sticky;
+  position: sticky;
+  top: 0;
+  left: 0;
+  background: #fff;
 }
 
 .listItem image {
@@ -42,7 +47,7 @@
   position: absolute;
   left: 0;
   top: 0;
-  background: linear-gradient(-143.9deg, rgba(15,217,170, 1), rgba(56, 194, 223, 1));
+  background: linear-gradient(-143.9deg, rgba(15, 217, 170, 1), rgba(56, 194, 223, 1));
   border-radius: 10rpx 0rpx 10rpx 0rpx;
   font-size: 20rpx;
   font-family: PingFangSC-Regular;
@@ -112,45 +117,51 @@
   position: absolute;
   left: 0;
   top: 0;
-  background: linear-gradient(-143.9deg, rgba(15,217,170, 1), rgba(56, 194, 223, 1));
+  background: linear-gradient(-143.9deg, rgba(15, 217, 170, 1), rgba(56, 194, 223, 1));
   border-radius: 10rpx 0rpx 10rpx 0rpx;
   font-size: 20rpx;
   font-family: PingFangSC-Regular;
   color: rgba(255, 255, 255, 1);
   line-height: 28rpx;
 }
+
 .loading {
   font-size: 25rpx;
-  color: #C4C4C4
+  color: #c4c4c4;
 }
 
-.mh{
+.mh {
   min-height: 90rpx;
 }
 
 /*用来包裹所有的小圆点  */
-.dots{  
+
+.dots {
   width: 110rpx;
-  height: 15rpx; 
+  height: 15rpx;
   display: flex;
   flex-direction: row;
   position: absolute;
   left: 50%;
   bottom: 40rpx;
   margin-left: -55rpx;
-}  
+}
+
 /*未选中时的小圆点样式 */
-.dot{  
-  width: 10rpx;  
-  height: 10rpx;   
+
+.dot {
+  width: 10rpx;
+  height: 10rpx;
   border-radius: 50%;
   margin-right: 10rpx;
-   background: rgba(215, 215, 215, 1);
-}  
+  background: rgba(215, 215, 215, 1);
+}
+
 /*选中以后的小圆点样式  */
-.active{  
-  width: 25rpx;   
+
+.active {
+  width: 25rpx;
   height: 10rpx;
   border-radius: 8rpx;
   background: #0ea79b;
-} 
+}

+ 83 - 0
src/pages/link/link.js

@@ -0,0 +1,83 @@
+// pages/link/link.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+    textList:['宝藏湾','迪士尼','游乐园'],
+    banText: '宝藏湾',
+    tab:1
+  },
+  swiperChange:function(e){
+    console.log(e.detail.current)
+    let index = e.detail.current
+    this.setData({
+      index: index,
+      banText: this.data.textList[index]
+    })
+  },
+  changeTab:function(e){
+    console.log(e.currentTarget.dataset.tab)
+    let tab = e.currentTarget.dataset.tab
+    this.setData({
+      tab: tab
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
src/pages/link/link.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 168 - 0
src/pages/link/link.wxml

@@ -0,0 +1,168 @@
+<!--pages/link/link.wxml-->
+<view class='pad20 flex flex-end green1 w100 b-box'>
+  <navigator url='/pages/index/index' open-type='switchTab' hover-class='none' class='flex flex-aic'>
+    <image src='/img/fanhui.png' style='width:36rpx;height:36rpx;'></image>
+    <view class='f24 cfff ml10'>返回首页</view>
+  </navigator>
+  <view class='flex flex-aic ml30'>
+    <image src='/img/mark.png' style='width:36rpx;height:36rpx;'></image>
+    <view class='f24 cfff ml10'>收藏</view>
+  </view>
+  <button open-type='share' hover-class='none' class='flex flex-aic ml30'>
+    <image src='/img/zhuanfa.png' style='width:36rpx;height:36rpx;'></image>
+    <view class='f24 cfff ml10'>转发</view>
+  </button>
+</view>
+<view class='flex green1 w100 b-box'>
+  <view class='flex-1 flex flex-center'>
+    <view class='h88 cfff f32 flex flex-center curr'>产品预定</view>
+  </view>
+  <navigator url='/pages/activityDetail/activityDetail?id=1051' hover-class='none' class='flex-1 flex flex-center'>
+    <view class='h88 cfff f32 flex flex-center'>游玩攻略</view>
+  </navigator>
+</view>
+
+<view class='flex flex-center flex-column por green3 banner w100 b-box'>
+  <image src='/img/link1.png' style='width:80%;z-index:998;' mode='widthFix' class='mt20 por'></image>
+  <text class='f20 cfff' style='z-index:999;'>Come to Disney on vacation!</text>
+  <image src='/img/star1.png' style='width:30rpx;height:30rpx;position:absolute;top:280rpx;left:60rpx;z-index:999'></image>
+  <image src='/img/star2.png' style='width:60rpx;height:60rpx;position:absolute;top:180rpx;right:60rpx;z-index:999'></image>
+  <image src='https://656e-env-da67fe-1258706283.tcb.qcloud.la/link2.png?sign=eb30468aadc7f8ad2da5384d14021394&t=1551251281' style='width:100%;position:absolute;top:0;left:0;z-index:0'></image>
+  <view class='flex pl20 pr20 flex-center flex-column por content w100 b-box'>
+    <image src='/img/link3.png' style='width:240rpx;' mode='widthFix'></image>
+    <view class='por w100'>
+      <image src='/img/star1.png' style='width:60rpx;height:60rpx;position:absolute;top:96rpx;left:-20rpx;'></image>
+      <image src='/img/ball.png' style='width:60rpx;height:84rpx;position:absolute;top:80rpx;right:-20rpx;'></image>
+      <view class='flex'>
+        <image src='/img/link5.png' class='w100' mode='widthFix'></image>
+      </view>
+      <view class='green f32' style='position:absolute;top:20rpx;left:50%;transform: translateX(-50%);'>1分钟了解上海迪士尼</view>
+      <view class='gray f26' style='position:absolute;top:80rpx;left:50%;transform: translateX(-50%);width:80%;'>上海迪士尼度假区是中国大陆首座迪士尼度假区,是世界上最大的迪士尼城堡,准备好开始探索这七大各具魅力而令人难忘的神奇园区。</view>
+    </view>
+
+
+  </view>
+</view>
+
+
+
+
+<view class='f60 bold cfff flex flex-center mb20 mt20 b-box w100 por'>
+  <image src='/img/text_bao.png' class='poa' style='width:90%;top:50%;transform: translate(-50%,-50%);left:50%;' mode='widthFix'></image>
+  <text>{{banText}}</text>
+</view>
+
+
+<view class='flex flex-center flex-column por w100 b-box' style='padding:20rpx 60rpx;'>
+  <image src='/img/link4.png' class='poa' style='top:0;left:50%;transform: translateX(-50%);height:100%;width:95%;z-index:-1;'></image>
+  <swiper autoplay interval="2000" duration="500" circular class='w100 flex flex-center' indicator-active-color='#0ea79b' style='height:400rpx;' bindchange='swiperChange'>
+    <block>
+      <swiper-item class='flex flex-bt flex-aic'>
+        <view class='flex flex-column mt20'>
+          <image src='/img/link8.png' style='width:291rpx;height:221rpx;'></image>
+          <view class='gray f28 mt20' style='width:291rpx;'>
+            <text class='black bold'>加勒比海盗:</text>来加入杰克船长的海盗队伍,来一场寻宝之旅 </view>
+        </view>
+        <view class='flex flex-column mt20'>
+          <image src='/img/link8.png' style='width:291rpx;height:221rpx;'></image>
+          <view class='gray f28 mt20' style='width:291rpx;'>
+            <text class='black bold'>加勒比海盗:</text>来加入杰克船长的海盗队伍,来一场寻宝之旅 </view>
+        </view>
+      </swiper-item>
+    </block>
+    <block>
+      <swiper-item class='flex flex-bt flex-aic'>
+        <view class='flex flex-column mt20'>
+          <image src='/img/link8.png' style='width:291rpx;height:221rpx;'></image>
+          <view class='gray f28 mt20' style='width:291rpx;'>
+            <text class='black bold'>加勒比海盗:</text>来加入杰克船长的海盗队伍,来一场寻宝之旅 </view>
+        </view>
+        <view class='flex flex-column mt20'>
+          <image src='/img/link8.png' style='width:291rpx;height:221rpx;'></image>
+          <view class='gray f28 mt20' style='width:291rpx;'>
+            <text class='black bold'>加勒比海盗:</text>来加入杰克船长的海盗队伍,来一场寻宝之旅 </view>
+        </view>
+      </swiper-item>
+    </block>
+    <block>
+      <swiper-item class='flex flex-bt flex-aic'>
+        <view class='flex flex-column mt20'>
+          <image src='/img/link8.png' style='width:291rpx;height:221rpx;'></image>
+          <view class='gray f28 mt20' style='width:291rpx;'>
+            <text class='black bold'>加勒比海盗:</text>来加入杰克船长的海盗队伍,来一场寻宝之旅 </view>
+        </view>
+        <view class='flex flex-column mt20'>
+          <image src='/img/link8.png' style='width:291rpx;height:221rpx;'></image>
+          <view class='gray f28 mt20' style='width:291rpx;'>
+            <text class='black bold'>加勒比海盗:</text>来加入杰克船长的海盗队伍,来一场寻宝之旅 </view>
+        </view>
+      </swiper-item>
+    </block>
+  </swiper>
+  <view class='flex flex-center mb20'>
+    <view class='dot {{index==0?"active":""}}'></view>
+    <view class='dot {{index==1?"active":""}}'></view>
+    <view class='dot {{index==2?"active":""}}'></view>
+  </view>
+</view>
+
+<view class='flex flex-column flex-center pad20 por mt20 w100 b-box'>
+  <image src='/img/link9.png' class='poa' mode='widthFix' style='width:95%;top:0;left:50%;transform:translateX(-50%);z-index:-1;'></image>
+  <view class='flex f28 pad30 flex' style='width:80%;'>
+    <view class='green flex-1 flex flex-center {{tab==1?"curr2":""}}' data-tab='1' bindtap='changeTab'>门票导览</view>
+    <view class='green flex-1 flex flex-center {{tab==2?"curr2":""}}' data-tab='2' bindtap='changeTab'>联票套餐</view>
+  </view>
+  <navigator url='/pages/travel/detail?viewId=view_1121785' hover-class='none' class='flex' style='border-top: 4rpx dashed #25DACC;width:86%;padding:50rpx 0;'>
+    <image src='/img/link8.png' style='width:253rpx;height:190rpx;'></image>
+    <view class='flex flex-column flex-1 ml20'>
+      <view class='c333 f32'>上海迪士尼·1日票</view>
+      <view class='gray f26 mt10'>老少皆宜, 探索奇幻城堡一票畅玩</view>
+      <view class='flex flex-end'>
+        <view class='order f28 cfff flex flex-center'>立即预订</view>
+      </view>
+    </view>
+  </navigator>
+
+  <navigator url='/pages/travel/detail?viewId=view_1121785' hover-class='none' class='flex' style='border-top: 4rpx dashed #25DACC;width:86%;padding:50rpx 0;'>
+    <image src='/img/link8.png' style='width:253rpx;height:190rpx;'></image>
+    <view class='flex flex-column flex-1 ml20'>
+      <view class='c333 f32'>上海迪士尼·1日票</view>
+      <view class='gray f26 mt10'>老少皆宜, 探索奇幻城堡一票畅玩</view>
+      <view class='flex flex-end'>
+        <view class='order f28 cfff flex flex-center'>立即预订</view>
+      </view>
+    </view>
+  </navigator>
+
+  <navigator url='/pages/travel/detail?viewId=view_1121785' hover-class='none' class='flex' style='border-top: 4rpx dashed #25DACC;width:86%;padding:50rpx 0;'>
+    <image src='/img/link8.png' style='width:253rpx;height:190rpx;'></image>
+    <view class='flex flex-column flex-1 ml20'>
+      <view class='c333 f32'>上海迪士尼·1日票</view>
+      <view class='gray f26 mt10'>老少皆宜, 探索奇幻城堡一票畅玩</view>
+      <view class='flex flex-end'>
+        <view class='order f28 cfff flex flex-center'>立即预订</view>
+      </view>
+    </view>
+  </navigator>
+  <navigator url='/pages/travel/detail?viewId=view_1121785' hover-class='none' class='flex' style='border-top: 4rpx dashed #25DACC;width:86%;padding:50rpx 0;'>
+    <image src='/img/link8.png' style='width:253rpx;height:190rpx;'></image>
+    <view class='flex flex-column flex-1 ml20'>
+      <view class='c333 f32'>上海迪士尼·1日票</view>
+      <view class='gray f26 mt10'>老少皆宜, 探索奇幻城堡一票畅玩</view>
+      <view class='flex flex-end'>
+        <view class='order f28 cfff flex flex-center'>立即预订</view>
+      </view>
+    </view>
+  </navigator>
+</view>
+
+<view class='flex flex-center w100 b-box' style='margin:80rpx 0;'>
+  <navigator url='/pages/myOrder/myOrder?state=&stateIndex=0' hover-class='none' class='checkOrder flex flex-center'>
+    <image src='/img/link11.png' style='width:40rpx;height:40rpx;'></image>
+    <text class='f28 cfff ml20'>查看订单</text>
+  </navigator>
+  <button open-type='contact' hover-class='none' class='contact flex flex-center ml20'>
+    <image src='/img/link12.png' style='width:40rpx;height:40rpx;'></image>
+    <text class='f28 cfff ml20'>联系客服</text>
+  </button>
+</view>

+ 97 - 0
src/pages/link/link.wxss

@@ -0,0 +1,97 @@
+/* pages/link/link.wxss */
+
+page {
+  background: #25DACC;
+  width: 100%;
+  box-sizing: border-box;
+  padding-bottom: 20rpx;
+}
+.green1{
+  background: #1CC0B3
+}
+.green2{
+  background:#1BC6B8 ;
+  
+}
+.green3{
+  background: #25DACC;
+}
+.banner{
+  /* background-image: url('https://656e-env-da67fe-1258706283.tcb.qcloud.la/link2.png?sign=eb30468aadc7f8ad2da5384d14021394&t=1551251281');
+  background-repeat: no-repeat;
+  background-size: cover; */
+}
+.content{
+  /* position: absolute; */
+  /* bottom: -117rpx; */
+  /* left: 50%; */
+  /* transform: translateX(-50%); */
+  width: 100%;
+  /* height: 244rpx; */
+}
+.dot{
+  background: #D7D7D7;
+  width:10rpx;
+  height: 10rpx;
+  border-radius: 50%;
+  margin: 0 6rpx;
+}
+.active{
+  width: 20rpx;
+  height: 10rpx;
+  background: #0EA79B;
+  border-radius: 6rpx;
+  margin: 0 6rpx;
+}
+.curr {
+  border-bottom: 4rpx solid #fff;
+}
+
+.curr2 {
+  font-weight: bolder;
+}
+
+.bannerImg {
+  position: absolute;
+  top: 0;
+  left: 0;
+  /* transform: translate(-50%,-50%); */
+  z-index: 1;
+}
+
+.green {
+  color: #188879;
+}
+
+.gray {
+  color: #4a4a4a;
+}
+
+.black {
+  color: #222;
+}
+
+.order {
+  width: 160rpx;
+  height: 50rpx;
+  background: linear-gradient(142deg, rgba(253, 190, 58, 1) 0%, rgba(253, 107, 44, 1) 100%);
+  border-radius: 50rpx;
+}
+
+.checkOrder {
+  width: 335rpx;
+  height: 86rpx;
+  background: linear-gradient(161deg, rgba(3, 207, 219, 1) 0%, rgba(18, 220, 156, 1) 100%);
+  box-shadow: 0rpx 5rpx 16rpx 0rpx rgba(22, 167, 156, 1);
+  border-radius: 43rpx;
+  opacity: 0.9;
+}
+
+.contact {
+  width: 335rpx;
+  height: 86rpx;
+  background: linear-gradient(164deg, rgba(35, 219, 192, 1) 0%, rgba(28, 213, 192, 1) 20%, rgba(0, 187, 193, 1) 100%);
+  box-shadow: 0rpx 5rpx 16rpx 0rpx rgba(20, 173, 161, 1);
+  border-radius: 43rpx;
+  opacity: 0.9;
+}

+ 4 - 4
src/pages/me/me.js

@@ -63,10 +63,10 @@ Page({
     // if (!areaId || areaId == 'null') {
     //   areaId = ''
     // }
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/ticket/views',
       {
         // areaId,

+ 13 - 10
src/pages/menpiao/index.js

@@ -96,10 +96,10 @@ Page({
 
   //获取城市
   getAreas() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/common/areas',
       {
         areaType: 0, //周边地区
@@ -170,10 +170,10 @@ Page({
     }
     let themeId = this.data.themeId
     console.log('areaId', areaId)
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/ticket/products',
       {
         areaId,
@@ -188,7 +188,7 @@ Page({
           let datas = res.data.results
           for (let data of datas) {
             data.startTime = Math.floor(data.startTime / 60)
-            data.infoTitle = data.infoTitle.length > 16 ? data.infoTitle.substring(0, 16) + '...' : data.infoTitle
+            // data.infoTitle = data.infoTitle.length > 16 ? data.infoTitle.substring(0, 16) + '...' : data.infoTitle
           }
           let result = []
           for (var i = 0, len = datas.length; i < len; i += 2) {
@@ -291,7 +291,10 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function() {
-
+    console.log('scrolltolower')
+    if (!this.data.viewLock && this.data.isAll == 0) {
+      this.getViews()
+    }
   },
 
   /**

+ 45 - 12
src/pages/menpiao/index.wxml

@@ -40,11 +40,11 @@
       </swiper-item>
     </block>
   </swiper>
-  <view class="dots">  
-      <block wx:for="{{products}}">  
-          <view class="dot{{index == current ? ' active' : ''}}"></view>  
-      </block>  
-  </view>  
+  <view class="dots">
+    <block wx:for="{{products}}">
+      <view class="dot{{index == current ? ' active' : ''}}"></view>
+    </block>
+  </view>
 </view>
 
 <view class='greyBar mt20'></view>
@@ -53,16 +53,16 @@
   <view class='flex flex-center flex-1'>目的地
     <image class='ml10' src="/img/xl.png" style='width:20rpx;height:20rpx'></image>
   </view>
-  <navigator open-type='navigate'  hover-class='none' url='/pages/activityDetail/activityDetail?id=1051' >
-  <view class='flex flex-center flex-1'>可订今日  
-  </view>
+  <navigator open-type='navigate' hover-class='none' url='/pages/activityDetail/activityDetail?id=1051'>
+    <view class='flex flex-center flex-1'>可订今日
+    </view>
   </navigator>
   <view class='flex flex-center flex-1'>默认排序
     <image class='ml10' src="/img/xl.png" style='width:20rpx;height:20rpx'></image>
   </view>
 </view>
 
-<scroll-view scroll-y='{{true}}' style='height:1090rpx' bindscrolltolower='scrolltolower'>
+<!-- <scroll-view scroll-y='{{true}}' style='height:1090rpx' bindscrolltolower='scrolltolower'>
   <view class='listItem pad40 b-box flex bdb' wx:for='{{views}}' wx:key='{{item.viewId}}' data-viewId='{{item.viewId}}' bindtap='openViewDetail'>
     <image src="{{item.signImg}}" style='width:280rpx;height:200rpx;border-radius:10rpx;'></image>
     <view class='flex flex-column ml20 flex-bt'>
@@ -84,10 +84,44 @@
           <view class='cred f36 bold'>{{item.minPrice / 100}}</view>
           <view class='mt10 f24 c333 ml10' style='color:#9B9B9B'>起</view>
         </view>
-        <!-- <view class='f24' style='color:#717171'>距我1.75km</view> -->
       </view>
     </view>
   </view>
+  <view class='listItem pad40 b-box flex' wx:if='{{isAll == 0}}'>
+    <view class='flex flex-center flex-1 loading'>
+      <loading></loading>
+    </view>
+  </view>
+  <view class='listItem pad40 b-box flex' wx:elif='{{isAll == 2}}'>
+    <view class='flex flex-center flex-1 loading'>
+      暂无数据
+    </view>
+  </view>
+</scroll-view> -->
+<view class='listItem pad40 b-box flex bdb' wx:for='{{views}}' wx:key='{{item.viewId}}' data-viewId='{{item.viewId}}' bindtap='openViewDetail'>
+  <image src="{{item.signImg}}" style='width:280rpx;height:200rpx;border-radius:10rpx;'></image>
+  <view class='flex flex-column ml20 flex-bt'>
+    <view>
+      <view class='f32 c333 bold'>{{item.viewName}}</view>
+      <view class='flex mt10'>
+        <view class='tip flex flex-center'>{{item.startDay == 0 ? '今日可用' : '提前' + item.startDay + '天订'}}</view>
+        <view class='tip flex flex-center ml10'>官方电子票</view>
+        <view class='tip flex flex-center ml10'>快速入园</view>
+      </view>
+      <view class='flex mt10 flex-aic'>
+        <view class='f26 bdr pr10' style='color:#FB8E00'>4.9分 很好 </view>
+        <view class='c666 f26 ml10'> 已销售3000+笔</view>
+      </view>
+    </view>
+    <view class='flex flex-aic flex-bt'>
+      <view class='flex flex-aic'>
+        <view class='mt10 f28 cred '>¥</view>
+        <view class='cred f36 bold'>{{item.minPrice / 100}}</view>
+        <view class='mt10 f24 c333 ml10' style='color:#9B9B9B'>起</view>
+      </view>
+    </view>
+  </view>
+</view>
 <view class='listItem pad40 b-box flex' wx:if='{{isAll == 0}}'>
   <view class='flex flex-center flex-1 loading'>
     <loading></loading>
@@ -98,6 +132,5 @@
     暂无数据
   </view>
 </view>
-</scroll-view>
-<backtotop floorstatus='{{floorstatus}}'></backtotop>
 
+<backtotop floorstatus='{{floorstatus}}'></backtotop>

+ 5 - 0
src/pages/menpiao/index.wxss

@@ -21,6 +21,11 @@
 
 .sortBox {
   height: 120rpx;
+  position: -webkit-sticky;
+  position: sticky;
+  top: 0;
+  left: 0;
+  background: #fff;
 }
 
 .listItem image {

+ 1 - 1
src/pages/needKnow/needKnow.wxml

@@ -45,7 +45,7 @@
       <image src='/img/aside.png' style='width:6rpx;height:28rpx'></image>
       <text class='f32 c333 ml20'>使用说明:</text>
     </view>
-    <view class='flex flex-aic pl20 ml20'>
+    <view class='flex flex-ais pl20 ml20'>
       <text class='f28 c666'>使用方法:</text>      
       <view class='c333 f28 flex-1'>{{prodDetail.userNote}}</view>
     </view>

+ 48 - 21
src/pages/orderDetail/orderDetail.js

@@ -1,6 +1,6 @@
 // pages/orderDetail/orderDetail.js
 import { shuoAPIClient } from '../../common/api/api.js';
-import { formatDate } from '../../lib/util/util.js';
+// import { formatDate } from '../../lib/util/util.js';
 Page({
 
   /**
@@ -63,7 +63,30 @@ Page({
   onShow: function () {
     
   },
-
+  formatDate:(d)=>{
+    let date=new Date(d)
+    let year = date.getFullYear()
+    let month = date.getMonth() + 1
+    let day = date.getDate()
+    month = month < 10 ? '0' + month : month
+    day = day < 10 ? '0' + day : day
+    return year + '-' + month + '-' + day
+  },
+  formatDate2: (d) => {
+    let date = new Date(d)
+    let year = date.getFullYear()
+    let month = date.getMonth() + 1
+    let day = date.getDate()
+    let hour = date.getHours()
+    let minute = date.getMinutes()
+    let second = date.getSeconds()
+    month = month < 10 ? '0' + month : month
+    day = day < 10 ? '0' + day : day
+    hour = hour < 10 ? '0' + hour : hour
+    minute = minute < 10 ? '0' + minute : minute
+    second = second < 10 ? '0' + second : second
+    return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
+  },
   orderDetail() {
     if (!this.data.orderId) {
       wx.showModal({
@@ -73,17 +96,19 @@ Page({
       });
       return false
     }
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/tickets/order/' + this.data.orderId,
       {}, true).then(res => {
         wx.hideLoading()
         console.log('订单详情', res)
         if (res.data && res.data) {
-          res.data.travelDate = formatDate(res.data.travelDate, 'yyyy-MM-dd')
-          res.data.orderDate = formatDate(res.data.orderDate, 'yyyy-MM-dd hh:mm:ss')
+          // res.data.travelDate = formatDate(res.data.travelDate, 'yyyy-MM-dd')
+          res.data.travelDate = this.formatDate(res.data.travelDate)
+          // res.data.orderDate = formatDate(res.data.orderDate, 'yyyy-MM-dd hh:mm:ss')
+          res.data.orderDate = this.formatDate2(res.data.orderDate)
           this.setData({
             orderDetail: res.data
           })
@@ -116,6 +141,8 @@ Page({
           if (res.data && res.data) {
             if (res.data.state == 2) {
               wx.hideLoading()
+              res.data.travelDate = self.formatDate(res.data.travelDate)
+              res.data.orderDate = self.formatDate2(res.data.orderDate)
               self.setData({
                 orderDetail: res.data
               })
@@ -135,10 +162,10 @@ Page({
     },1000)
   },
   getProdDetail(infoId) {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/ticket/product/' + infoId,
       {}, false).then(res => {
         wx.hideLoading()
@@ -155,10 +182,10 @@ Page({
    * 支付
    */
   pay() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/order/payInfo/' + this.data.orderDetail.orderId,
       {}, true).then(res => {
         wx.hideLoading()
@@ -190,13 +217,13 @@ Page({
    * 取消订单
    */
   cancelOrder() {
-    wx.showLoading({
-      title: '加载中...',
-      mask: true
-    });
+    // wx.showLoading({
+    //   title: '加载中...',
+    //   mask: true
+    // });
     shuoAPIClient.request('/api/minapp/order/' + this.data.orderDetail.orderId,
       {}, true, 'DELETE').then(res => {
-        wx.hideLoading()
+       
         console.log('取消订单', res)
         if (res.data && res.data) {
           if (res.data.state == 1) {

+ 3 - 3
src/pages/orderDetail/orderDetail.wxml

@@ -25,9 +25,9 @@
   </view>
 
   <view class='pt20'>
-    <view class='flex ' style='background:#F6FAFC;padding-left: 8rpx;padding:5rpx;'>
-      <text class='f24 green text1'>退改说明:</text>
-      <text class='f24 red text2'>{{prodDetail.refundNote}}</text>
+    <view class='flex' style='background:#F6FAFC;padding-left: 8rpx;padding:5rpx;'>
+      <view class='f24 green flex flex-center'>退改说明:</view>
+      <view class='f24 red flex flex-1 flex-center'>{{prodDetail.refundNote}}</view>
     </view>
 
   </view>

+ 2 - 2
src/pages/orderDetail/orderDetail.wxss

@@ -16,10 +16,10 @@ page{
   left: 0;
 }
 .text1{
-  width:230rpx;
+  /* width:230rpx; */
 }
 .text2{
-  width: 160%;
+  /* width: 160%; */
   display: -webkit-box;
   overflow: hidden;
   text-overflow: ellipsis;

+ 5 - 1
src/pages/repay/repay.js

@@ -26,7 +26,11 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-  
+    wx.showToast({
+      title: '有些事情现在不做,就一辈子也不会做了',
+      icon: "none",
+      duration: 2000
+    })
   },
 
   /**

+ 60 - 2
src/pages/selectOwner/editOwner.js

@@ -7,12 +7,70 @@ Page({
   data: {
   
   },
-
+  inputName:function(e){
+    
+    this.setData({
+      name: e.detail.value
+    })
+  },
+  inputphone:function(e){
+    this.setData({
+      phone: e.detail.value
+    })
+  },
+  inputcard:function(e){
+    this.setData({
+      card: e.detail.value
+    })
+  },
+  save:function(){
+    let obj={}
+    let book=this.data.book
+    obj.name=this.data.name
+    obj.phone=this.data.phone
+    obj.card=this.data.card
+    if (this.data.isEdit){
+      book[this.data.index] = obj
+    }
+    book.push(obj)
+    wx.setStorageSync('book', book)
+    wx.showToast({
+      title: '保存成功'
+    })
+    wx.navigateBack({
+      
+    })
+  },
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-  
+    wx.getStorage({
+      key: 'book',
+      success: res => {
+        console.log(res)
+        this.setData({
+          book: res.data
+        })
+        if (options.index) {
+          this.setData({
+            isEdit: true,
+            index: options.index,
+            name: res.data[options.index].name,
+            phone: res.data[options.index].phone,
+            card: res.data[options.index].card
+          })
+        }
+      },
+      fail: err => {
+        console.log(err)
+        this.setData({
+          book: []
+        })
+      }
+    })
+    
+    
   },
 
   /**

+ 4 - 4
src/pages/selectOwner/editOwner.wxml

@@ -6,11 +6,11 @@
   </view>
   <view class='flex flex-aic pt20 pb20 bdb'>
     <text class='f28 c333'>中文姓名:</text>
-    <input placeholder='取票人姓名' placeholder-class='f28 c999'></input>
+    <input placeholder='取票人姓名' placeholder-class='f28 c999' bindinput='inputName' value='{{name}}'></input>
   </view>
   <view class='flex flex-aic pt20 pb20 bdb'>
     <text class='f28 c333'>手机号码:</text>
-    <input placeholder='请输入手机号码' placeholder-class='f28 c999'></input>
+    <input placeholder='请输入手机号码' placeholder-class='f28 c999' bindinput='inputphone' value='{{phone}}'></input>
   </view>
   <view class='flex flex-aic pt20 pb20 bdb'>
     <text class='f28 c333'>证件类型:</text>
@@ -18,9 +18,9 @@
   </view>
   <view class='flex flex-aic pt20 '>
     <text class='f28 c333'>证件号码:</text>
-    <input placeholder='请输入证件号码' placeholder-class='f28 c999'></input>
+    <input placeholder='请输入证件号码' placeholder-class='f28 c999' bindinput='inputcard' value='{{card}}'></input>
   </view>
 
 </view>
 
-<view class='save f32 cfff flex flex-center'>保存</view>
+<view class='save f32 cfff flex flex-center' bindtap='save'>保存</view>

+ 75 - 18
src/pages/selectOwner/selectOwner.js

@@ -5,62 +5,119 @@ Page({
    * 页面的初始数据
    */
   data: {
-  
+    book: []
+  },
+  edit:function(e){
+    console.log(e.currentTarget.dataset.index)
+    let index = e.currentTarget.dataset.index
+    wx.navigateTo({
+      url: `/pages/selectOwner/editOwner?index=${index}`
+    })
+  },
+  remove: function(e) {
+    let index = e.detail.value
+    let book = this.data.book
+    console.log(e)
+    book.splice(index, 1)
+    wx.setStorage({
+      key: 'book',
+      data: book
+    })
+    this.getBook()
+  },
+  getBook: function() {
+    wx.getStorage({
+      key: 'book',
+      success: res => {
+        this.setData({
+          book: res.data
+        })
+      },
+    })
+  },
+  select:function(e){
+    console.log(e.currentTarget.dataset.index)
+    let index = e.currentTarget.dataset.index
+    let book=this.data.book
+    book[index].selected=1
+    book.forEach((o,i)=>{
+      if(i==index){
+        o.selected=1
+      }else{
+        o.selected = 0
+      }
+    })
+    wx.setStorage({
+      key: 'book',
+      data: book
+    })
+    let page = getCurrentPages()
+    console.log(page)
+    let r = page[page.length-2]
+    let linkInfo = r.data.linkInfo
+    linkInfo[0].nameValue = book[index].name
+    linkInfo[0].phoneValue = book[index].phone
+    linkInfo[0].idCardValue = book[index].card
+    r.setData({
+      linkInfo: linkInfo
+    })
+    wx.navigateBack({
+      
+    })
   },
-
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
-  
+  onLoad: function(options) {
+
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function () {
-  
+  onReady: function() {
+
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function () {
-  
+  onShow: function() {
+    this.getBook()
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
-  onHide: function () {
-  
+  onHide: function() {
+
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload: function () {
-  
+  onUnload: function() {
+
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
-  onPullDownRefresh: function () {
-  
+  onPullDownRefresh: function() {
+
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom: function () {
-  
+  onReachBottom: function() {
+
   },
 
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage: function () {
-  
+  onShareAppMessage: function() {
+
   }
 })

+ 11 - 12
src/pages/selectOwner/selectOwner.wxml

@@ -4,25 +4,24 @@
     <image src='/img/add.png' style='width:22rpx;height:22rpx;'></image>
     <text class='f30 green ml20'>新增常用取票人</text>
   </navigator>
-  <view class='bgfff flex flex-ais flex-column pad20 ' style='width:80%;margin:20rpx auto;border-radius:10rpx;'>
+  <view class='bgfff flex flex-ais flex-column pad20 ' style='width:80%;margin:20rpx auto;border-radius:10rpx;' wx:for='{{book}}' wx:key='item' bindtap='select' data-index='{{index}}'>
     <view class='flex flex-bt flex-aic w100 mb20'>
       <view class='flex flex-aic'>
-        <image src='/img/circle.png' style='width:30rpx;height:30rpx;'></image>
-        <text class='f30 c4a ml10'>李筱筱</text>
+        <image src='/img/selected.png' wx:if='{{item.selected}}' style='width:30rpx;height:30rpx;'></image>
+        <image src='/img/circle.png' wx:else style='width:30rpx;height:30rpx;'></image>
+
+        <text class='f30 c4a ml10'>{{item.name}}</text>
       </view>
       <view class='flex flex-aic flex-bt'>
-        <navigator class='flex' url='/pages/selectOwner/editOwner' hover-class='none'>
-          <image src='/img/edit.png' style='width:28rpx;height:28rpx;' class='mr20'></image>
-        </navigator>
-
-        <image src='/img/delete.png' style='width:28rpx;height:28rpx;' class='ml20'></image>
+        <image src='/img/edit.png' style='width:28rpx;height:28rpx;' class='mr20' catchtap='edit' data-index='{{index}}'></image>
+        <image src='/img/delete.png' style='width:28rpx;height:28rpx;' class='ml20' data-index='{{index}}' catchtap='remove'></image>
       </view>
     </view>
-    <view class='f26 c4a'>手机号:180 0000 000</view>
-    <view class='f26 c4a'>身份证:510824 1992 0923 0014</view>
+    <view class='f26 c4a'>手机号:{{item.phone}}</view>
+    <view class='f26 c4a'>身份证:{{item.card}}</view>
   </view>
 
-  <view class='bgfff flex flex-ais flex-column pad20 ' style='width:80%;margin:20rpx auto;border-radius:10rpx;'>
+  <!-- <view class='bgfff flex flex-ais flex-column pad20 ' style='width:80%;margin:20rpx auto;border-radius:10rpx;'>
     <view class='flex flex-bt flex-aic w100 mb20'>
       <view class='flex flex-aic'>
         <image src='/img/selected.png' style='width:30rpx;height:30rpx;'></image>
@@ -38,5 +37,5 @@
     </view>
     <view class='f26 c4a'>手机号:180 0000 000</view>
     <view class='f26 c4a'>身份证:510824 1992 0923 0014</view>
-  </view>
+  </view> -->
 </view>

+ 3 - 1
src/pages/travel/detail.wxss

@@ -1,5 +1,7 @@
 /* pages/travel/detail.wxss */
-
+page{
+  box-sizing: border-box;
+}
 .topBg {
   position: relative;
   z-index: -1;

+ 28 - 5
src/project.config.json

@@ -33,7 +33,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 8,
+			"current": 11,
 			"list": [
 				{
 					"id": -1,
@@ -42,10 +42,11 @@
 					"query": ""
 				},
 				{
-					"id": -1,
+					"id": 1,
 					"name": "活动详情",
 					"pathName": "pages/activityDetail/activityDetail",
-					"query": ""
+					"query": "id=1051",
+					"scene": null
 				},
 				{
 					"id": -1,
@@ -60,10 +61,11 @@
 					"query": ""
 				},
 				{
-					"id": -1,
+					"id": 4,
 					"name": "订单填写",
 					"pathName": "pages/creatOrder/creatOrder",
-					"query": ""
+					"query": "infoId=8459494",
+					"scene": null
 				},
 				{
 					"id": -1,
@@ -88,6 +90,27 @@
 					"name": "dt",
 					"pathName": "pages/ditu/index",
 					"query": ""
+				},
+				{
+					"id": -1,
+					"name": "链接页",
+					"pathName": "pages/link/link",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "发现",
+					"pathName": "pages/huiTravel/index",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "订单详情",
+					"pathName": "pages/orderDetail/orderDetail",
+					"query": "orderId=91262626&isPay=2",
+					"scene": null
 				}
 			]
 		}