From c93b64cdb162593d37c0660b428bcb4f4321e22f Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Tue, 27 May 2025 15:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=AF=E5=8C=BA=E8=88=92=E9=80=82=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 3 +- pages/activity/year2020/index.js | 2 +- pages/component/TitleHeader.js | 4 +- pages/kj/info/index.js | 2 +- pages/login/index.js | 10 +- pages/pbService/aiHelpYou/index.js | 129 ++++++++++++++++++++++++ pages/pbService/aiHelpYou/index.json | 3 + pages/pbService/aiHelpYou/index.wxml | 4 + pages/pbService/aiHelpYou/index.wxss | 1 + pages/pbService/sceneComfort/index.js | 2 +- pages/pbService/sceneComfort/index.wxml | 14 +-- pages/user/bindtel/index.js | 2 +- utils/https.js | 4 +- 13 files changed, 156 insertions(+), 24 deletions(-) create mode 100644 pages/pbService/aiHelpYou/index.js create mode 100644 pages/pbService/aiHelpYou/index.json create mode 100644 pages/pbService/aiHelpYou/index.wxml create mode 100644 pages/pbService/aiHelpYou/index.wxss diff --git a/app.json b/app.json index 5684680..cc141f1 100644 --- a/app.json +++ b/app.json @@ -2,6 +2,7 @@ "pages": [ "pages/index/index", "pages/map/index", + "pages/pbService/aiHelpYou/index", "pages/search/index", "pages/search/list/index", "pages/login/index", @@ -252,7 +253,7 @@ "selectedColor": "#D22A1C", "borderStyle": "white", "list": [ - { + { "pagePath": "pages/index/index", "iconPath": "/images/index.png", "selectedIconPath": "/images/aindex_seld.png", diff --git a/pages/activity/year2020/index.js b/pages/activity/year2020/index.js index f911e1d..277634c 100644 --- a/pages/activity/year2020/index.js +++ b/pages/activity/year2020/index.js @@ -98,7 +98,7 @@ Page({ util.gotoDetail(item) }, home:function(){ - wx.reLaunch({ + wx.switchTab({ url: '/pages/index/index', }) }, diff --git a/pages/component/TitleHeader.js b/pages/component/TitleHeader.js index 9da6b3a..1fc9b5a 100644 --- a/pages/component/TitleHeader.js +++ b/pages/component/TitleHeader.js @@ -65,7 +65,7 @@ Component({ }) } else { - wx.reLaunch({ + wx.switchTab({ url: "/pages/index/index" }) } @@ -108,7 +108,7 @@ Component({ }) } else { - wx.reLaunch({ + wx.switchTab({ url: "/pages/index/index" }) } diff --git a/pages/kj/info/index.js b/pages/kj/info/index.js index 1d8d83f..1cca5b8 100644 --- a/pages/kj/info/index.js +++ b/pages/kj/info/index.js @@ -105,7 +105,7 @@ Page({ }) } else { - wx.reLaunch({ + wx.switchTab({ url: '/pages/index/index', }) } diff --git a/pages/login/index.js b/pages/login/index.js index d6166db..8e629e8 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -42,7 +42,7 @@ Page({ }, cancel:function(){ util.pagePoint({event:this.data.event+'cancel'},1) - wx.reLaunch({ + wx.switchTab({ url: '/pages/index/index', }) }, @@ -74,7 +74,7 @@ Page({ let that = this; if (e.detail && (!e.detail.userInfo)){ - wx.reLaunch({ + wx.switchTab({ url: '/pages/index/index', }) return; @@ -110,18 +110,18 @@ Page({ } else { console.log('看这里看这里看这里') - wx.reLaunch({ + wx.switchTab({ url:"/pages/index/index" }) } }).catch(err=>{ - wx.reLaunch({ + wx.switchTab({ url:"/pages/index/index" }) }) }, fail:function(){ - wx.reLaunch({ + wx.switchTab({ url:"/pages/index/index" }) } diff --git a/pages/pbService/aiHelpYou/index.js b/pages/pbService/aiHelpYou/index.js new file mode 100644 index 0000000..cb6c043 --- /dev/null +++ b/pages/pbService/aiHelpYou/index.js @@ -0,0 +1,129 @@ +// pages/pbService/web/index.js +let app = getApp() +import commonApi from "../../../utils/https/common" +import userApi from "../../../utils/https/user" +import https from "../../../utils/https.js" +Page({ + + /** + * 页面的初始数据 + */ + data: { + webUrl:"", + shareTitle: "", + shareUrl: "", + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + let weburl = 'https://test.m.cloud.sz-trip.com/aiPlay' + let token = wx.getStorageSync('jstrip_token') + if (token) { + weburl += '?token='+token + } + let _this = this + try { + let lonAndLat = (wx.getStorageSync('lonAndLat')) + if (lonAndLat && JSON.parse(lonAndLat)) { + lonAndLat = JSON.parse(lonAndLat) + if (Object.keys(webParam).length>0 || token) { + weburl+=`&lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` + } else { + weburl+=`?lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` + } + this.setUrl(weburl) + return + } else { + wx.getLocation({ + type: 'gcj02', + success: (res) => { + let lonAndLat = JSON.stringify({lat: res.latitude,lon: res.longitude}) + wx.setStorageSync('lonAndLat', lonAndLat) + if (Object.keys(webParam).length>0 || token) { + weburl+=`&lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` + } else { + weburl+=`?lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` + } + _this.setUrl(weburl) + }, + fail: (err) => { + _this.setUrl(weburl) + } + }) + } + } catch(e) { + this.setUrl(weburl) + } + + }, + handleMessage(data) { + console.log('打印22222',data); + }, + + setUrl (url) { + this.setData({ + webUrl:url + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + return { + title: this.data.shareTitle, + path: `/pages/pbService/web/index?weburl=${encodeURIComponent(this.data.webUrl)}`, + } + }, + + onShareTimeline: function() { + return { + title: this.data.shareTitle, + path: `/pages/pbService/web/index?weburl=${encodeURIComponent(this.data.webUrl)}`, + } + } +}) \ No newline at end of file diff --git a/pages/pbService/aiHelpYou/index.json b/pages/pbService/aiHelpYou/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/pbService/aiHelpYou/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/pbService/aiHelpYou/index.wxml b/pages/pbService/aiHelpYou/index.wxml new file mode 100644 index 0000000..f6c048b --- /dev/null +++ b/pages/pbService/aiHelpYou/index.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/pages/pbService/aiHelpYou/index.wxss b/pages/pbService/aiHelpYou/index.wxss new file mode 100644 index 0000000..3d9e18a --- /dev/null +++ b/pages/pbService/aiHelpYou/index.wxss @@ -0,0 +1 @@ +/* pages/pbService/web/index.wxss */ \ No newline at end of file diff --git a/pages/pbService/sceneComfort/index.js b/pages/pbService/sceneComfort/index.js index f026153..7415b96 100644 --- a/pages/pbService/sceneComfort/index.js +++ b/pages/pbService/sceneComfort/index.js @@ -112,7 +112,7 @@ Page({ commonApi._post("pbservice/Comfort/getComfort",{ scene_name:this.data.keywords, comfort_level:this.data.comfortIndex>0?this.data.comfortLevel[this.data.comfortIndex].level:null, - area_key:this.data.areaIndex>0?this.data.areas[this.data.areaIndex].area_code:null, + area_key:this.data.areaIndex>0?this.data.areas[this.data.areaIndex].area_name:null, page_no:this.data.pageNo, page_num:10, scene_level:this.data.sceneLevelIndex>0?this.data.sceneLevel[this.data.sceneLevelIndex].level:null diff --git a/pages/pbService/sceneComfort/index.wxml b/pages/pbService/sceneComfort/index.wxml index bf7d5bd..3fb22bf 100644 --- a/pages/pbService/sceneComfort/index.wxml +++ b/pages/pbService/sceneComfort/index.wxml @@ -31,7 +31,7 @@ - 舒适度: + 舒适度: {{item.desc}} 更新时间:{{list[0].status_time}} @@ -42,7 +42,7 @@ 景区舒适度 - + 本预测趋势图由AI生成,内容仅供参考。 @@ -71,22 +71,16 @@ 未来一小时: - {{item.comforLevel.desc}} + {{item.hourflowLeve.desc}} - + 更新时间:{{item.status_time}} - - - - - - diff --git a/pages/user/bindtel/index.js b/pages/user/bindtel/index.js index ce73a3f..82055f8 100644 --- a/pages/user/bindtel/index.js +++ b/pages/user/bindtel/index.js @@ -31,7 +31,7 @@ Page({ }) }, cancel:function(){ - wx.reLaunch({ + wx.switchTab({ url: '/pages/index/index', }) }, diff --git a/utils/https.js b/utils/https.js index 67031b4..1a81b17 100644 --- a/utils/https.js +++ b/utils/https.js @@ -1,8 +1,8 @@ var app = getApp(); import util from "../utils/util" // import userApi from "../utils/https/user.js"; -// const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; -let baseUrl = "https://api.cloud.sz-trip.com/api/"; +const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; +// let baseUrl = "https://api.cloud.sz-trip.com/api/"; const env = wx.getAccountInfoSync().miniProgram.envVersion if (env == 'develop1') { baseUrl = "https://test.api.cloud.sz-trip.com/api/"