Browse Source

跳转三方小程序fix

master
jiazhipeng 10 months ago
parent
commit
70695b87b7
  1. 5
      pages/info/sceneProductInfo/index.js
  2. 14
      pages/order/components/date/index.js
  3. 6
      pages/order/components/date/index.wxml
  4. 7
      pages/order/components/date/index.wxss
  5. 18
      subPackages/transferPage/transferPage.js

5
pages/info/sceneProductInfo/index.js

@ -793,7 +793,10 @@ Page({
product.productNum = 1 product.productNum = 1
app.globalData.product = { app.globalData.product = {
...sku, ...sku,
...product ...product,
// changeFlag: true,
// date: {date: "2025-06-24"},
} }
console.log(app.globalData.product); console.log(app.globalData.product);
console.log(ticket_type); console.log(ticket_type);

14
pages/order/components/date/index.js

@ -46,7 +46,8 @@ Component({
tomorrow:util.formatMing(new Date()), tomorrow:util.formatMing(new Date()),
afterTom:util.formatHou(new Date()), afterTom:util.formatHou(new Date()),
skuName:'', skuName:'',
monthList:[] monthList:[],
scrollLeft: 0
}, },
lifetimes: { lifetimes: {
attached: function () { attached: function () {
@ -122,14 +123,21 @@ Component({
item.week = this.getDay(item.date) item.week = this.getDay(item.date)
}) })
let seldDate = '' let seldDate = ''
let leftIndex = 0;
if (app.globalData.product.changeFlag) { if (app.globalData.product.changeFlag) {
if( app.globalData.product.date) { if( app.globalData.product.date) {
res.data.forEach(item=> {
res.data.forEach((item,index)=> {
if (item.date == app.globalData.product.date.date) { if (item.date == app.globalData.product.date.date) {
seldDate = item seldDate = item
leftIndex = index
} }
}) })
} }
this.setData({
scrollLeft: 70*leftIndex
})
setTimeout(() => { setTimeout(() => {
this.changeDate(seldDate) this.changeDate(seldDate)
}) })
@ -239,7 +247,7 @@ Component({
for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
if (res.data[i].stock_number > 0) { if (res.data[i].stock_number > 0) {
if (app.globalData.product.changeFlag) { if (app.globalData.product.changeFlag && app.globalData.product.time) {
if (res.data[i].start_time == app.globalData.product.time.start_time) { if (res.data[i].start_time == app.globalData.product.time.start_time) {
timeIndex = i; timeIndex = i;
break; break;

6
pages/order/components/date/index.wxml

@ -28,7 +28,8 @@
使用日期 使用日期
</view> </view>
<view class="dates-boxes"> <view class="dates-boxes">
<view style="width: 580rpx;display: flex;overflow-x: scroll;"> <scroll-view scroll-x enable-flex scroll-left="{{scrollLeft}}"
style="height: 133rpx;width: 580rpx;display: flex;overflow-x: scroll;flex-direction: row;">
<view bindtap="changeDate" data-date="{{item}}" class="date-item{{activeDate.date==item.date?' active':''}}{{(item.stock<=0 || item.stock==null || item.price==null)?' disable':''}}" wx:for-index="index" wx:for="{{monthList}}"> <view bindtap="changeDate" data-date="{{item}}" class="date-item{{activeDate.date==item.date?' active':''}}{{(item.stock<=0 || item.stock==null || item.price==null)?' disable':''}}" wx:for-index="index" wx:for="{{monthList}}">
<!-- <view>{{tool.showAllSeldDate(item.date,index,today,tomorrow,afterTom)}}</view> --> <!-- <view>{{tool.showAllSeldDate(item.date,index,today,tomorrow,afterTom)}}</view> -->
<view>{{item.week}}</view> <view>{{item.week}}</view>
@ -38,7 +39,8 @@
<!-- <view class="price" wx:if="{{item.stock==null || item.price==null}}">不可定</view> --> <!-- <view class="price" wx:if="{{item.stock==null || item.price==null}}">不可定</view> -->
<view class="price" wx:if="{{item.stock==0}}">{{item.tipText?item.tipText:'售罄'}}</view> <view class="price" wx:if="{{item.stock==0}}">{{item.tipText?item.tipText:'售罄'}}</view>
</view> </view>
</view> <view style="width: 2rpx;height: 1rpx;flex-shrink: 0;"></view>
</scroll-view>
<view class="more-item" bindtap="showMoreDate"> <view class="more-item" bindtap="showMoreDate">
<!-- <view wx:if="{{moreFlag || !activeDate}}" class="date-item more-item" bindtap="showMoreDate"> --> <!-- <view wx:if="{{moreFlag || !activeDate}}" class="date-item more-item" bindtap="showMoreDate"> -->
<view style="width:58rpx;margin-right:12rpx;"> <view style="width:58rpx;margin-right:12rpx;">

7
pages/order/components/date/index.wxss

@ -18,6 +18,7 @@
align-items: center; align-items: center;
padding: 0 0 31rpx; padding: 0 0 31rpx;
border:none; border:none;
position: relative;
/* padding: 31rpx 0; */ /* padding: 31rpx 0; */
/* padding: 31rpx 21rpx; */ /* padding: 31rpx 21rpx; */
/* border-top: 1rpx solid #ccc; */ /* border-top: 1rpx solid #ccc; */
@ -68,13 +69,17 @@
/* margin-right: 0; */ /* margin-right: 0; */
position: absolute; position: absolute;
right: 0; right: 0;
top: 0;
text-align: center; text-align: center;
padding: 0 26rpx 0 24rpx; padding: 0 0rpx 0 16rpx;
display: flex; display: flex;
font-weight: 400; font-weight: 400;
font-size: 27rpx; font-size: 27rpx;
color: #0B898E; color: #0B898E;
align-items: center; align-items: center;
height: 133rpx;
background: white;
border-radius: 10rpx;
} }
.date-times { .date-times {
display: flex; display: flex;

18
subPackages/transferPage/transferPage.js

@ -39,9 +39,25 @@ Page({
}) })
}, },
fail: (e)=>{ fail: (e)=>{
console.log(e) try {
let errMsg = e.errMsg
if (errMsg.indexOf("TAP")>=0) {
wx.showModal({
title: "确认跳转",
showCancel: false,
success: ()=>{
this.goOtherMiniProgrogram(data)
}
})
} else {
wx.navigateBack() wx.navigateBack()
} }
} catch (e) {
wx.navigateBack()
}
console.log("aaa",e)
}
}) })
}, },

Loading…
Cancel
Save