Browse Source

webview 修改

master
jiazhipeng 8 months ago
parent
commit
c5e2c9864b
  1. 2
      app.js
  2. 4
      pages/index/index.wxss
  3. 2
      pages/info/sceneProductInfo/index.js
  4. 6
      pages/pbService/index.wxml
  5. 21
      pages/pbService/web/index.js
  6. 7
      project.private.config.json

2
app.js

@ -38,7 +38,7 @@ App({
// 获取前端配置文件
commonApi._post("pbservice/Other/getClientConfig", {unique_key: "wechatxcx"}).then(res => {
let data = JSON.parse(res.data);
data.isTest = data.isTest109? true : false;
data.isTest = data.isTest111? true : false;
data.indexSeason = null
this.globalData.configJson = data
}).then(() => {

4
pages/index/index.wxss

@ -426,9 +426,11 @@
margin-bottom: 40rpx;
}
.pbservice {
width: calc(186rpx * 7);
/* width: calc(186rpx * 7); */
display: flex;
flex-wrap: wrap;
flex-direction: column;
height: 350rpx;
}
.pbservice-item {
/* 元旦修改 截止到注释的width*/

2
pages/info/sceneProductInfo/index.js

@ -1005,7 +1005,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
commonApi.user_post('cart/get_list', {}).then(res => {
commonApi.user_post('cart/get_list', {noLogin: true}).then(res => {
this.setData({
cartCount: res.data.length //1
})

6
pages/pbService/index.wxml

@ -60,6 +60,12 @@
<image src="https://static.ticket.sz-trip.com/xcxImages/index/pb4New.png" mode="widthFix"></image>
<view>12348</view>
</view>
<view bindtap="gotoUrl" data-title="文化场馆查询" data-url="https://m.cloud.sz-trip.com/Museum" class="pb-item">
<image src="https://static.ticket.sz-trip.com/uploads/20250812/ed95e68969c28c75e1ed348a56d4c198.png" mode="widthFix"></image>
<view>文化场馆查询</view>
</view>
</view>
</view>
<image class="title-img" src="https://static.ticket.sz-trip.com/uploads/20211115/335a42385c9e15ece075980209b0643a.png"

21
pages/pbService/web/index.js

@ -24,7 +24,9 @@ Page({
console.log('weburl',weburl)
// 获取路径参数
let webParam = {}
let baseUrl = ""
try {
baseUrl = weburl.split('?')[0]
let paramStr = weburl.split('?')[1]
if (paramStr) {
paramStr.split('&').forEach((param) => {
@ -37,6 +39,7 @@ Page({
console.log(e)
}
console.log(webParam)
let lowerUrl = weburl.toLowerCase()
// 宠你有礼 市民卡授权
if (lowerUrl.indexOf('petyou2024') && webParam.cnylCode) {
@ -78,6 +81,19 @@ Page({
}
// 君到苏州 加token
else if(lowerUrl.indexOf('m.cloud.sz-trip.com')!=-1) {
delete webParam.token
delete webParam.lon
delete webParam.lat
weburl = baseUrl
if(Object.keys(webParam).length>0) {
const newParamsArray = [];
for (let key in webParam) {
newParamsArray.push(`${key}=${(webParam[key])}`);
}
weburl = `${baseUrl}?${newParamsArray.join('&')}`;
}
let token = wx.getStorageSync('jstrip_token')
if (token) {
if (Object.keys(webParam).length>0) {
@ -119,9 +135,7 @@ Page({
} catch(e) {
this.setUrl(weburl)
}
// this.setData({
// webUrl:weburl
// })
// this.setUrl(weburl)
} else {
// this.setData({
// webUrl:weburl
@ -186,6 +200,7 @@ Page({
},
setUrl (url) {
console.log(url)
let that = this
if (this.data.canSetData) {
this.data.canSetData = false

7
project.private.config.json

@ -6,6 +6,13 @@
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/pbService/web/index",
"pathName": "pages/pbService/web/index",
"query": "weburl=https%253A%252F%252Fm.cloud.sz-trip.com%252FmeetingLotus2025%253Ftoken%253D180c8775-e37f-4f91-a638-1d7f90069c52%2526lon%253D120.63327853732639%2526lat%253D31.26709312760416",
"launchMode": "default",
"scene": null
},
{
"name": "pages/info/postProductInfo/index",
"pathName": "pages/info/postProductInfo/index",

Loading…
Cancel
Save