diff --git a/pages.json b/pages.json index 9fe952d..f92468b 100644 --- a/pages.json +++ b/pages.json @@ -13,6 +13,13 @@ "navigationBarTitleText": "我的" } }, + { + "path": "pages/map/map", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "智游常熟" + } + }, { "path": "pages/login/login", "style": { @@ -113,6 +120,12 @@ "navigationBarTitleText": "全部订单" } }, + { + "path": "order/orderPay", + "style": { + "navigationBarTitleText": "支付" + } + }, { "path": "eventCalendar/eventCalendar", "style": { @@ -125,12 +138,19 @@ "style": { "navigationBarTitleText": "活动详情" } + }, + { + "path": "webPage/webPage", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } } ] }], "tabBar": { "color": "#999999", - "selectedColor": "#333333", + "selectedColor": "#00AEA0", "borderStyle": "black", "backgroundColor": "#ffffff", "fontSize": "24rpx", @@ -142,6 +162,12 @@ "selectedIconPath": "/static/images/selectHome.png", "text": "首页" }, + { + "pagePath": "pages/map/map", + "iconPath": "/static/images/map.png", + "selectedIconPath": "/static/images/selectMap.png", + "text": "地图" + }, { "pagePath": "pages/user/user", "iconPath": "/static/images/mine.png", diff --git a/pages/index/index.vue b/pages/index/index.vue index 0176ef0..67a16bb 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -29,12 +29,12 @@ - + {{item.title}} 查看更多产品 > - + {{pItem.title}} @@ -51,7 +51,7 @@ - + {{calendarItem.name}} @@ -87,7 +87,7 @@ - + @@ -178,13 +178,21 @@ title: '景点', id: '619', spanColor: '#529AE7', - list: [] + list: [], + url: { + jump_type:3, + tdata: 'https://m.cloud.sz-trip.com/AttractionsTickets' + } }, { title: '特产', id: '620', spanColor: '#EE710C', - list: [] + list: [], + url: { + jump_type:3, + tdata: 'https://m.cloud.sz-trip.com/CulturalCreation' + } } ], calendarItem: {}, @@ -269,6 +277,82 @@ }, 500); }, methods: { + // banner跳转 + // 2是各种详情页,3是列表专题页面,4是小程序 + gotoUrlNew(item) { + console.log(item); + let that = this; + let url = ''; + switch (item.jump_type) { + case 0: + break; + case 2: + uni.navigateTo({ + url: item.tdata + }); + break; + case 3: + let isJDSZ = this.goJDSZMiniProgram(item.tdata) + if (isJDSZ) return + uni.navigateTo({ + url: '/subPackages/webPage/webPage?url=' + item.tdata + }); + break; + case 4: + uni.navigateToMiniProgram({ + appId: item.tdata.appid, // 此为appid + path: item.tdata.page, // 此为首页路径 + envVersion: 'release', + success: res => { + // 打开成功 + console.log('打开成功', res); + }, + fail: err => { + console.log(err); + } + }); + break; + default: + break; + } + }, + // 判断是否跳转君到苏州专题页 + goJDSZMiniProgram (tpage) { + if (tpage.indexOf('m.cloud.sz-trip.com') > -1) { + // 如果已登录但没有手机号,直接去授权页面 + let userInfo = null + try { + userInfo = JSON.parse(uni.getStorageSync('userInfo')) + + } catch(e) {} + if (userInfo && userInfo.token && !userInfo.mobile) { + uni.showToast({ + title: '未授权手机号', + icon: 'none' + }) + // 去登录页面授权 + setTimeout(()=>{ + uni.navigateTo({ + url: '/pages/login/login?needAuth=1' + }) + },200) + + + return true + } + + // 获取授权code + this.checkIsLoginJdsz().then(res => { + if(res) { + uni.navigateTo({ + url: '/subPackages/webPage/webPage?url=' + encodeURIComponent(`${tpage}?token=` + res + '&isKunshan=1') + }); + } + }) + return true + } + return false + }, // 瀑布流 getColumnItems(columnIndex) { const columnItems = []; @@ -282,9 +366,8 @@ getBanner() { // 获取顶部banner this.Post({ - apiType: 'jdsz', - type_id: 5, - position: 0, + type_id: 3, + position: 6, }, '/api/adv/getAdv').then(res => { if(res) { this.topBanner = res.data @@ -293,8 +376,7 @@ // 小banner this.Post({ - apiType: 'jdsz', - type_id: 5, + type_id: 3, position: 1, }, '/api/adv/getAdv').then(res => { if(res) { diff --git a/pages/map/map.vue b/pages/map/map.vue new file mode 100644 index 0000000..02409e3 --- /dev/null +++ b/pages/map/map.vue @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/static/images/home.png b/static/images/home.png index 9d13426..82ac36a 100644 Binary files a/static/images/home.png and b/static/images/home.png differ diff --git a/static/images/map.png b/static/images/map.png new file mode 100644 index 0000000..93e5a4d Binary files /dev/null and b/static/images/map.png differ diff --git a/static/images/mine.png b/static/images/mine.png index 67970d8..54d64d1 100644 Binary files a/static/images/mine.png and b/static/images/mine.png differ diff --git a/static/images/selectHome.png b/static/images/selectHome.png index 2359413..35c660f 100644 Binary files a/static/images/selectHome.png and b/static/images/selectHome.png differ diff --git a/static/images/selectMap.png b/static/images/selectMap.png new file mode 100644 index 0000000..9fb1eba Binary files /dev/null and b/static/images/selectMap.png differ diff --git a/static/images/selectMine.png b/static/images/selectMine.png index 16e1d34..84a5f77 100644 Binary files a/static/images/selectMine.png and b/static/images/selectMine.png differ diff --git a/static/js/CommonFunction.js b/static/js/CommonFunction.js index f82fcb7..1fd8d92 100644 --- a/static/js/CommonFunction.js +++ b/static/js/CommonFunction.js @@ -233,7 +233,128 @@ Vue.prototype.getHeadImg = type => { }); } +// 判断君到苏州token是否生效 +Vue.prototype.checkIsLoginJdsz = () => { + Vue.prototype.Post({ + apiType: 'jdsz', + }, '/api/uservice/user/getMyInfo').then(res => { + if(res.code == 1 || res.code == 200) { + return res.data.token + }else if(res.code == 401) { + // 重新登陆 + Vue.prototype.Post({}, '/api/user/getAuthCode').then(res => { + if (res.code == 1 || res.code == 200) { + Vue.prototype.Post({ + apiType: 'jdsz', + }, '/api/uservice/user/loginBykunshan').then(res => { + if(res.data.code == 401) { + this.$store.commit('changeLoginPath') + return; + } + uni.setStorageSync('jdszToken', res.data.data.token) + }) + } + }).catch(res => { + if (res.data.code == 201) { + uni.showToast({ + title: '未授权手机号', + icon: 'none' + }) + // 去登录页面授权 + setTimeout(()=>{ + uni.navigateTo({ + url: '/pages/login/login?needAuth=1' + }) + },400) + } + }) + } + }) +} + // 跳转君到苏州详情 -Vue.prototype.gotoDetailByType = item => { +Vue.prototype.gotoDetailByTypeToJdsz = item => { + let httpUrl = 'https://m.cloud.sz-trip.com/' + let url = '' + + // 酒景套餐 + if (item.is_package) { + url = httpUrl + 'MailMerchandiseDetail?id=' + item.id + } + + switch (item.type) { + case 'ticket': // 是产品的 票务 + url = httpUrl + 'ScenicDetail?id=' + item.scene_id || item.id + break; + case 'hotel': // 是产品的 酒店 + url = httpUrl + 'HotelDetail?id=' + item.scene_id || item.id + break; + case 'post': // 是产品的 邮寄 + url = httpUrl + 'MailMerchandiseDetail?id=' + item.id + break; + case 'line': // 是产品的 线路 + url = httpUrl + 'LineDetail?id=' + item.id + break; + case 'coupon': // 是产品的 卡券 + url = httpUrl + 'CardDetail?id=' + item.id + break; + case 'show': // 是产品的 演出 + url = httpUrl + 'PerformDetail?id=' + item.id + break; + case 'food': // 是产品的 食品 + url = httpUrl + 'FoodDetail?id=' + item.id + break; + case 'activity': // 是产品的 活动 todo 这里要弄成是活动的id去跳转的,特别是从 江苏夜游过去的 + url = httpUrl + 'AppointmentDetail?id=' + item.act_calendar_id || item.id + break; + case 'calendar': // ai入口活动日历 + url = httpUrl + 'AppointmentDetail?id=' + item.id + break; + case 'movie': // 是产品的 电影 + url = httpUrl + 'MovieDetail?id=' + item.third_id || item.id + break; + case 'scenic': // 是场景的 景点 + url = httpUrl + 'ScenicDetail?id=' + item.scene_id || item.id + break; + case 'room': // 是场景的 酒店 + url = httpUrl + 'HotelDetail?id=' + item.scene_id || item.id + break; + case 'restaurant': // 是场景 美食 + url = httpUrl + 'RestaurantDetail?id=' + item.id + break; + case 'tenscenic': // 是场景 十景 + url = httpUrl + 'TenScenicDetail?id=' + item.id + break; + case 'venue': // 是场景的 场馆 + url = httpUrl + 'PavilionDetail?id=' + item.scene_id || item.id + break; + case 'cinema': // 是场景的 影院 + url = httpUrl + 'CinemaDetail?id=' + item.third_id || item.id + break; + case 'relic': // 文物 + url = httpUrl + 'ProtectionUnitsInfo?id=' + item.id + break; + case 'units': // 文化单位 + url = httpUrl + 'CulturalUnitInfo?id=' + item.id + break; + case 'red_map': // 红色地图 + url = httpUrl + 'RedTouristInfo?id=' + item.id + break; + case 'travels': // 红色地图 + url = httpUrl + 'TravelNotesIntroductionInfo?id=' + item.id + break; + } + + uni.navigateTo({ + url: '/subPackages/webPage/webPage?url=' + encodeURIComponent(url) + }); + return; + Vue.prototype.checkIsLoginJdsz().then(res => { + if(res) { + uni.navigateTo({ + url: '/subPackages/webPage/webPage?url=' + encodeURIComponent(url + '&token=' + res) + }); + } + }) } \ No newline at end of file diff --git a/static/js/request.js b/static/js/request.js index a68fafa..7628d93 100644 --- a/static/js/request.js +++ b/static/js/request.js @@ -15,8 +15,7 @@ const getToken = () => { return userInfo.token; } } - // return store.state.user.userInfo.token; - return "ce870b90-d976-42b7-b4d8-d2957316886b" + return store.state.user.userInfo.token; }; // 定义错误处理函数 diff --git a/subPackages/order/detail.vue b/subPackages/order/detail.vue new file mode 100644 index 0000000..933f5a1 --- /dev/null +++ b/subPackages/order/detail.vue @@ -0,0 +1,1578 @@ + + + + + \ No newline at end of file diff --git a/subPackages/order/orderCoupon.vue b/subPackages/order/orderCoupon.vue new file mode 100644 index 0000000..9b08ece --- /dev/null +++ b/subPackages/order/orderCoupon.vue @@ -0,0 +1,424 @@ + + + + + diff --git a/subPackages/order/orderPay.vue b/subPackages/order/orderPay.vue new file mode 100644 index 0000000..829e4d9 --- /dev/null +++ b/subPackages/order/orderPay.vue @@ -0,0 +1,400 @@ + + + + + \ No newline at end of file diff --git a/subPackages/peripheralActivity/peripheralActivity.vue b/subPackages/peripheralActivity/peripheralActivity.vue index 25da716..647c503 100644 --- a/subPackages/peripheralActivity/peripheralActivity.vue +++ b/subPackages/peripheralActivity/peripheralActivity.vue @@ -3,7 +3,7 @@ - + {{item.name}} diff --git a/subPackages/webPage/webPage.vue b/subPackages/webPage/webPage.vue new file mode 100644 index 0000000..208fb2f --- /dev/null +++ b/subPackages/webPage/webPage.vue @@ -0,0 +1,27 @@ + + + + + + \ No newline at end of file