Browse Source

强制关注,电影下单页调整

master
nige 3 years ago
parent
commit
b4edfb6d4e
  1. 32
      pages/info/hotelProductInfo/index.js
  2. 4
      pages/info/hotelProductInfo/index.json
  3. 5
      pages/info/hotelProductInfo/index.wxml
  4. 17
      pages/info/museumInfo/index.js
  5. 4
      pages/info/museumInfo/index.json
  6. 2
      pages/info/museumInfo/index.wxml
  7. 37
      pages/info/postProductInfo/index.js
  8. 4
      pages/info/postProductInfo/index.json
  9. 2
      pages/info/postProductInfo/index.wxml
  10. 101
      pages/info/roadInfo/index.js
  11. 4
      pages/info/roadInfo/index.json
  12. 2
      pages/info/roadInfo/index.wxml
  13. 36
      pages/info/sceneProductInfo/index.js
  14. 5
      pages/info/sceneProductInfo/index.json
  15. 2
      pages/info/sceneProductInfo/index.wxml
  16. 223
      pages/list/movieticket/list/ticket/index.js
  17. 3
      pages/list/movieticket/list/ticket/index.json
  18. 2
      pages/list/movieticket/list/ticket/index.wxml
  19. 42
      pages/order/components/wxqrCode/index.js
  20. 4
      pages/order/components/wxqrCode/index.json
  21. 13
      pages/order/components/wxqrCode/index.wxml
  22. 70
      pages/order/components/wxqrCode/index.wxss
  23. 9
      pages/order/movie/index.wxml
  24. 6
      pages/order/movie/index.wxss
  25. 34
      pages/user/cartlist/list.js
  26. 3
      pages/user/cartlist/list.json
  27. 2
      pages/user/cartlist/list.wxml

32
pages/info/hotelProductInfo/index.js

@ -37,7 +37,9 @@ Page({
roomInfo: null, roomInfo: null,
retailId: "", retailId: "",
shareImg: null, shareImg: null,
showShareFlag: false showShareFlag: false,
showQrCode: false,
wxqrcode: null
}, },
/** /**
@ -127,6 +129,18 @@ Page({
}) })
}, },
order: function (e) { order: function (e) {
console.log(this.data.sceneInfo);
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/info/hotelProductInfo/index?id=' + this.data.id,
title: this.data.sceneInfo.title,
type: 'mini'
}).then(res => {
if (res.data.subscribe == 0) {
this.setData({
wxqrcode: res.data.qrcode,
showQrCode: true
})
} else {
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
item.startDate = this.data.startDate; item.startDate = this.data.startDate;
item.endDate = this.data.endDate; item.endDate = this.data.endDate;
@ -140,8 +154,21 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: '/pages/order/hotel/index', url: '/pages/order/hotel/index',
}) })
}
})
}, },
orderMt: function (e) { orderMt: function (e) {
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/info/hotelProductInfo/index?id=' + this.data.id,
title: this.data.sceneInfo.title,
type: 'mini'
}).then(res => {
if (res.data.subscribe == 0) {
this.setData({
wxqrcode: res.data.qrcode,
showQrCode: true
})
} else {
let item = e.currentTarget.dataset.item, product = e.currentTarget.dataset.product; let item = e.currentTarget.dataset.item, product = e.currentTarget.dataset.product;
item.startDate = this.data.startDate; item.startDate = this.data.startDate;
item.endDate = this.data.endDate; item.endDate = this.data.endDate;
@ -165,6 +192,9 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: '/pages/order/hotel/index', url: '/pages/order/hotel/index',
}) })
}})
}, },
getDay: function (date) { getDay: function (date) {
let d = new Date(date.replace(/-/g, '/')).getDay(); let d = new Date(date.replace(/-/g, '/')).getDay();

4
pages/info/hotelProductInfo/index.json

@ -1,6 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"title":"/pages/component/TitleHeader", "title":"/pages/component/TitleHeader",
"common-image":"/pages/component/commonImage/index" "common-image":"/pages/component/commonImage/index",
"code":"../../order/components/wxqrCode/index"
} }
} }

5
pages/info/hotelProductInfo/index.wxml

@ -53,7 +53,8 @@
<common-image src="{{item.img_list[0]}}" mode="aspectFill"></common-image> <common-image src="{{item.img_list[0]}}" mode="aspectFill"></common-image>
<view class="product-info textOver"> <view class="product-info textOver">
<view class="title textOver"><view class="textOver">{{item.room_name}}</view></view> <view class="title textOver"><view class="textOver">{{item.room_name}}</view></view>
<view class="subtitle textOver2">{{item.useable_area?(item.useable_area+'m²'):''}} <text wx:for="{{item.bed_info}}">{{item.bedDesc}}{{item.bedType}}x{{item.bedCount}}</text> {{item.window?item.window:''}}</view> <!-- <view class="subtitle textOver2">{{item.useable_area?(item.useable_area+'m²'):''}} <text wx:for="{{item.bed_info}}">{{item.bedDesc}}{{item.bedType}}x{{item.bedCount}}</text> {{item.window?item.window:''}}</view> -->
<view class="subtitle textOver2">{{item.useable_area?(item.useable_area+'m²'):''}} {{item.window?item.window:''}} <text>{{item.capacity?item.capacity+'人入住':''}}</text></view>
<view class="mt-price">{{item.low_price>0?item.low_price/100:'0'}}</view> <view class="mt-price">{{item.low_price>0?item.low_price/100:'0'}}</view>
</view> </view>
<view class="product-right"> <view class="product-right">
@ -217,3 +218,5 @@
<view class="save-btn" bindtap="save">保存到相册</view> <view class="save-btn" bindtap="save">保存到相册</view>
</view> </view>
</view> </view>
<code showModel="{{showQrCode}}" qrcode = "{{wxqrcode}}">
</code>

17
pages/info/museumInfo/index.js

@ -26,7 +26,9 @@ Page({
retailId: "", retailId: "",
isGroup: null, isGroup: null,
shareImg: null, shareImg: null,
showShareFlag: false showShareFlag: false,
showQrCode:false,
wxqrcode:null
}, },
/** /**
@ -399,6 +401,17 @@ Page({
}) })
}, },
order: function () { order: function () {
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/info/museumInfo/index?id='+this.data.id,
title:this.data.info.title,
type: 'mini'
}).then(res => {
if (res.data.subscribe == 0) {
this.setData({
wxqrcode: res.data.qrcode,
showQrCode: true
})
} else {
this.data.isGroup = null this.data.isGroup = null
if(this.data.product.product.flag!=1 || this.data.product.sku.flag=='off') return; if(this.data.product.product.flag!=1 || this.data.product.sku.flag=='off') return;
if(this.data.isGroup){ if(this.data.isGroup){
@ -419,7 +432,7 @@ Page({
else { else {
this.realOrder() this.realOrder()
} }
}})
}, },
order1: function () { order1: function () {
this.data.isGroup = 1 this.data.isGroup = 1

4
pages/info/museumInfo/index.json

@ -1,6 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"title":"/pages/component/TitleHeader", "title":"/pages/component/TitleHeader",
"date":"/pages/order/components/date/index" "date":"/pages/order/components/date/index",
"code":"../../order/components/wxqrCode/index"
} }
} }

2
pages/info/museumInfo/index.wxml

@ -100,3 +100,5 @@
<view class="save-btn" bindtap="save">保存到相册</view> <view class="save-btn" bindtap="save">保存到相册</view>
</view> </view>
</view> </view>
<code showModel="{{showQrCode}}" qrcode = "{{wxqrcode}}">
</code>

37
pages/info/postProductInfo/index.js

@ -32,8 +32,10 @@ Page({
allowance_data: null, allowance_data: null,
showAllowance: false, showAllowance: false,
tjList: [], //推荐商品列表 tjList: [], //推荐商品列表
iShop:false, iShop: false,
supplierId:null supplierId: null,
showQrCode: false,
wxqrcode: null
}, },
/** /**
@ -73,8 +75,8 @@ Page({
res.data.flag = res.data.sku.find(item => item.flag == 'on') ? res.data.flag : 0 res.data.flag = res.data.sku.find(item => item.flag == 'on') ? res.data.flag : 0
this.setData({ this.setData({
info: res.data, info: res.data,
supplierId:res.data.supplier_id, supplierId: res.data.supplier_id,
iShop:res.data.supplier_id?true:false iShop: res.data.supplier_id ? true : false
}) })
// 获取补贴 // 获取补贴
@ -221,6 +223,17 @@ Page({
}, },
showCart: function () { showCart: function () {
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/info/postProductInfo/index?id=' + this.data.id,
title: this.data.info.title,
type: 'mini'
}).then(res => {
if (res.data.subscribe == 0) {
this.setData({
wxqrcode: res.data.qrcode,
showQrCode: true
})
} else {
if (this.data.info.sku.length == 0) { if (this.data.info.sku.length == 0) {
wx.showToast({ wx.showToast({
title: '该产品未设置规格,不能加购', title: '该产品未设置规格,不能加购',
@ -238,7 +251,8 @@ Page({
cartImgInfo: 'top:' + res.top + 'px;left:' + res.left + 'px;' cartImgInfo: 'top:' + res.top + 'px;left:' + res.left + 'px;'
}) })
}).exec() }).exec()
}
})
}, },
hideSku: function () { hideSku: function () {
this.setData({ this.setData({
@ -264,6 +278,17 @@ Page({
}) })
}, },
showOrder: function () { showOrder: function () {
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/info/postProductInfo/index?id=' + this.data.id,
title: this.data.info.title,
type: 'mini'
}).then(res => {
if (res.data.subscribe == 0) {
this.setData({
wxqrcode: res.data.qrcode,
showQrCode: true
})
} else {
if (this.data.info.sku.length == 0) { if (this.data.info.sku.length == 0) {
wx.showToast({ wx.showToast({
title: '该产品未设置规格,不能购买', title: '该产品未设置规格,不能购买',
@ -274,6 +299,8 @@ Page({
this.setData({ this.setData({
skuFlag: 'order' skuFlag: 'order'
}) })
}
})
}, },
order: function () { order: function () {
app.globalData.postProduct = null app.globalData.postProduct = null

4
pages/info/postProductInfo/index.json

@ -1,5 +1,7 @@
{ {
"usingComponents": { "usingComponents": {
"title":"/pages/component/TitleHeader" "title":"/pages/component/TitleHeader",
"code":"../../order/components/wxqrCode/index"
} }
} }

2
pages/info/postProductInfo/index.wxml

@ -204,3 +204,5 @@
<rich-text nodes="{{allowance_data.content}}"></rich-text> <rich-text nodes="{{allowance_data.content}}"></rich-text>
</view> </view>
</view> </view>
<code showModel="{{showQrCode}}" qrcode = "{{wxqrcode}}">
</code>

101
pages/info/roadInfo/index.js

@ -20,7 +20,9 @@ Page({
retailId: "", retailId: "",
retailSkuId: "", retailSkuId: "",
shareImg: null, shareImg: null,
showShareFlag: false showShareFlag: false,
showQrCode: false,
wxqrcode: null
}, },
/** /**
@ -54,7 +56,7 @@ Page({
retailSkuId: options.skuid retailSkuId: options.skuid
}) })
} }
res.data.flag = res.data.sku.find(item=>item.flag=='on')?res.data.flag:0 res.data.flag = res.data.sku.find(item => item.flag == 'on') ? res.data.flag : 0
this.setData({ this.setData({
info: res.data info: res.data
@ -85,16 +87,15 @@ Page({
source_id: this.data.info.id, source_id: this.data.info.id,
url: "/pages/info/cardInfo/index?id=" + this.data.info.id, url: "/pages/info/cardInfo/index?id=" + this.data.info.id,
uuid: app.globalData.uuid uuid: app.globalData.uuid
}).then(res => { }).then(res => {})
}) } else {
}
else {
this.BroswerRecord(); this.BroswerRecord();
} }
}, 500) }, 500)
}, },
changeMenu: function (e) { changeMenu: function (e) {
let index = e.currentTarget.dataset.index, that = this; let index = e.currentTarget.dataset.index,
that = this;
const query = wx.createSelectorQuery(); //创建节点查询器 const query = wx.createSelectorQuery(); //创建节点查询器
query.select("#box" + index).boundingClientRect() //选择toViewid获取位置信息 query.select("#box" + index).boundingClientRect() //选择toViewid获取位置信息
query.selectViewport().scrollOffset() //获取页面查询位置的 query.selectViewport().scrollOffset() //获取页面查询位置的
@ -110,7 +111,8 @@ Page({
}) })
}, },
onPageScroll: function (e) { onPageScroll: function (e) {
let that = this, height = this.data.top; let that = this,
height = this.data.top;
let topHeight = height; let topHeight = height;
wx.createSelectorQuery().select('#menus').boundingClientRect(function (rect) { wx.createSelectorQuery().select('#menus').boundingClientRect(function (rect) {
console.log(rect.top, topHeight) console.log(rect.top, topHeight)
@ -119,8 +121,7 @@ Page({
that.setData({ that.setData({
fixed: true fixed: true
}) })
} } else {
else {
that.setData({ that.setData({
fixed: false fixed: false
}) })
@ -137,18 +138,15 @@ Page({
that.setData({ that.setData({
type: 4 type: 4
}) })
} } else if (res[2].top < minHeight) {
else if (res[2].top < minHeight) {
that.setData({ that.setData({
type: 3 type: 3
}) })
} } else if (res[1].top < minHeight) {
else if (res[1].top < minHeight) {
that.setData({ that.setData({
type: 2 type: 2
}) })
} } else {
else {
that.setData({ that.setData({
type: 1 type: 1
}) })
@ -158,37 +156,53 @@ Page({
}, },
order: function () { order: function () {
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/info/roadInfo/index?id=' + this.data.id,
title: this.data.info.title,
type: 'mini'
}).then(res => {
if (res.data.subscribe == 0) {
this.setData({
wxqrcode: res.data.qrcode,
showQrCode: true
})
} else {
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
app.globalData.product = { app.globalData.product = {
product: this.data.info product: this.data.info
} }
app.globalData.retailId = this.data.retailId; app.globalData.retailId = this.data.retailId;
util.pagePoint({ util.pagePoint({
event:'product_order', event: 'product_order',
param:{ param: {
id:this.data.info.id, id: this.data.info.id,
type:this.data.info.type type: this.data.info.type
} }
},1) }, 1)
wx.setStorageSync('login_from', 'product_order_login') wx.setStorageSync('login_from', 'product_order_login')
wx.setStorageSync('order_from', 'product_order_submit') wx.setStorageSync('order_from', 'product_order_submit')
wx.navigateTo({ wx.navigateTo({
url: '/pages/order/road/index?id=' + this.data.info.id + (this.data.retailSkuId ? ('&skuid=' + this.data.retailSkuId) : '') url: '/pages/order/road/index?id=' + this.data.info.id + (this.data.retailSkuId ? ('&skuid=' + this.data.retailSkuId) : '')
}) })
}
})
}, },
pagePoint:function(e){ pagePoint: function (e) {
util.pagePoint(e) util.pagePoint(e)
}, },
// 分享 // 分享
share: function () { share: function () {
if (!wx.getStorageSync("jstrip_token")) { if (!wx.getStorageSync("jstrip_token")) {
util.pagePoint({ util.pagePoint({
event:'product_share_login', event: 'product_share_login',
param:{ param: {
id:that.data.info.id, id: that.data.info.id,
type:that.data.info.type type: that.data.info.type
} }
},1) }, 1)
commonApi.user_post("user/getMyInfo", {}).then(res => { commonApi.user_post("user/getMyInfo", {}).then(res => {
}) })
@ -207,7 +221,8 @@ Page({
}, },
// 保存 // 保存
save() { save() {
let url = this.data.shareImg, that = this; let url = this.data.shareImg,
that = this;
wx.authorize({ wx.authorize({
/* 这个就是保存相册的 */ /* 这个就是保存相册的 */
scope: 'scope.writePhotosAlbum', scope: 'scope.writePhotosAlbum',
@ -223,12 +238,12 @@ Page({
showShareFlag: !that.data.showShareFlag showShareFlag: !that.data.showShareFlag
}) })
util.pagePoint({ util.pagePoint({
event:'product_share_save', event: 'product_share_save',
param:{ param: {
id:that.data.info.id, id: that.data.info.id,
type:that.data.info.type type: that.data.info.type
} }
},1) }, 1)
}, },
fail(res) { fail(res) {
wx.showToast({ wx.showToast({
@ -259,7 +274,8 @@ Page({
}, },
// 绘制海报 // 绘制海报
drawImg: function () { drawImg: function () {
var that = this, userinfo = wx.getStorageSync('jstrip_userInfo'); var that = this,
userinfo = wx.getStorageSync('jstrip_userInfo');
if (!userinfo) { if (!userinfo) {
// 去登录 // 去登录
return false; return false;
@ -297,7 +313,7 @@ Page({
ctx.save(); ctx.save();
ctx.beginPath(); //开始绘制 ctx.beginPath(); //开始绘制
that.handleBorderRect(ctx, 0, 0, 551 * ratio, 407 * ratio, 25 * ratio, '#ccc') that.handleBorderRect(ctx, 0, 0, 551 * ratio, 407 * ratio, 25 * ratio, '#ccc')
ctx.clip();//画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因 ctx.clip(); //画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因
ctx.drawImage(imgs[0].path, 0, 0, 551 * ratio, 407 * ratio); ctx.drawImage(imgs[0].path, 0, 0, 551 * ratio, 407 * ratio);
ctx.restore(); ctx.restore();
ctx.save(); ctx.save();
@ -408,12 +424,13 @@ Page({
}, },
// 绘制两行文字 // 绘制两行文字
drawText: function (ctx, str, x, y, canvasWidth, ratio) { drawText: function (ctx, str, x, y, canvasWidth, ratio) {
let row = [], temp = "", chr = str.split(""); let row = [],
temp = "",
chr = str.split("");
for (var a = 0; a < chr.length; a++) { for (var a = 0; a < chr.length; a++) {
if (ctx.measureText(temp).width < canvasWidth) { if (ctx.measureText(temp).width < canvasWidth) {
temp += chr[a]; temp += chr[a];
} } else {
else {
a--; //这里添加了a-- 是为了防止字符丢失,效果图中有对比 a--; //这里添加了a-- 是为了防止字符丢失,效果图中有对比
row.push(temp); row.push(temp);
temp = ""; temp = "";
@ -430,13 +447,12 @@ Page({
for (var a = 0; a < rowPart.length; a++) { for (var a = 0; a < rowPart.length; a++) {
if (ctx.measureText(test).width < canvasWidth - 30 * ratio) { if (ctx.measureText(test).width < canvasWidth - 30 * ratio) {
test += rowPart[a]; test += rowPart[a];
} } else {
else {
break; break;
} }
} }
empty.push(test); empty.push(test);
var group = empty[0] + "..."//这里只显示两行,超出的用...表示 var group = empty[0] + "..." //这里只显示两行,超出的用...表示
rowCut.splice(1, 1, group); rowCut.splice(1, 1, group);
row = rowCut; row = rowCut;
} }
@ -461,8 +477,7 @@ Page({
} }
if (this.data.info && this.data.info.id) { if (this.data.info && this.data.info.id) {
this.drawImg() this.drawImg()
} } else {
else {
setTimeout(() => { setTimeout(() => {
this.onShow() this.onShow()
}, 200) }, 200)

4
pages/info/roadInfo/index.json

@ -1,5 +1,7 @@
{ {
"usingComponents": { "usingComponents": {
"title":"/pages/component/TitleHeader" "title":"/pages/component/TitleHeader",
"code":"../../order/components/wxqrCode/index"
} }
} }

2
pages/info/roadInfo/index.wxml

@ -119,3 +119,5 @@
<view class="save-btn" bindtap="save">保存到相册</view> <view class="save-btn" bindtap="save">保存到相册</view>
</view> </view>
</view> </view>
<code showModel="{{showQrCode}}" qrcode = "{{wxqrcode}}">
</code>

36
pages/info/sceneProductInfo/index.js

@ -32,7 +32,10 @@ Page({
cartTop: 0, cartTop: 0,
top: 0, top: 0,
skuList: [], //立即预定的列表 skuList: [], //立即预定的列表
sku_ids: [] sku_ids: [],
showQrCode: false,
wxqrcode: null
}, },
/** /**
@ -670,6 +673,17 @@ Page({
}, },
//加入购物车 //加入购物车
showCart: function () { showCart: function () {
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/info/sceneProductInfo/index?id=' + this.data.id,
title: this.data.info.title,
type: 'mini'
}).then(res => {
if (res.data.subscribe == 0) {
this.setData({
wxqrcode: res.data.qrcode,
showQrCode: true
})
} else {
if (this.data.info.product[0].sku.length == 0) { if (this.data.info.product[0].sku.length == 0) {
wx.showToast({ wx.showToast({
title: '该产品未设置规格,不能加购', title: '该产品未设置规格,不能加购',
@ -686,6 +700,11 @@ Page({
cartImgInfo: 'top:' + res.top + 'px;left:' + res.left + 'px;' cartImgInfo: 'top:' + res.top + 'px;left:' + res.left + 'px;'
}) })
}).exec() }).exec()
}
})
}, },
hideSku: function () { hideSku: function () {
@ -708,6 +727,18 @@ Page({
}, },
//立即预定 //立即预定
showOrder: function () { showOrder: function () {
console.log(this.data.id);
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/info/sceneProductInfo/index?id=' + this.data.id,
title: this.data.info.title,
type: 'mini'
}).then(res => {
if (res.data.subscribe == 0) {
this.setData({
wxqrcode: res.data.qrcode,
showQrCode: true
})
} else {
if (this.data.info.product[0].sku.length == 0) { if (this.data.info.product[0].sku.length == 0) {
wx.showToast({ wx.showToast({
title: '该产品未设置规格,不能购买', title: '该产品未设置规格,不能购买',
@ -724,6 +755,9 @@ Page({
this.setData({ this.setData({
skuFlag: 'order' skuFlag: 'order'
}) })
}
})
}, },
/** /**

5
pages/info/sceneProductInfo/index.json

@ -1,6 +1,9 @@
{ {
"usingComponents": { "usingComponents": {
"title":"/pages/component/TitleHeader", "title":"/pages/component/TitleHeader",
"notice":"/pages/component/notice/notice" "notice":"/pages/component/notice/notice",
"code":"../../order/components/wxqrCode/index"
} }
} }

2
pages/info/sceneProductInfo/index.wxml

@ -252,3 +252,5 @@
<rich-text nodes="{{info.allowance.content}}"></rich-text> <rich-text nodes="{{info.allowance.content}}"></rich-text>
</view> </view>
</view> </view>
<code showModel="{{showQrCode}}" qrcode = "{{wxqrcode}}">
</code>

223
pages/list/movieticket/list/ticket/index.js

@ -8,19 +8,21 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
id:null, id: null,
dates:[], dates: [],
days:['周日','周一','周二','周三','周四','周五','周六'], days: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
dateIndex:0, dateIndex: 0,
areas:[], areas: [],
areaIndex:0, areaIndex: 0,
lat:"", lat: "",
lon:"", lon: "",
sort:'distance', sort: 'distance',
list:[], list: [],
title:"", title: "",
page:1, page: 1,
isMore:true isMore: true,
showQrCode: false,
wxqrcode: null
}, },
/** /**
@ -31,178 +33,193 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
id:options.id, id: options.id,
title:options.title title: options.title
}) })
commonApi._post("act/get_suzhou_areas").then(res=>{ commonApi._post("act/get_suzhou_areas").then(res => {
res.data.unshift({ res.data.unshift({
area_id:"", area_id: "",
area_title:"苏州" area_title: "苏州"
}) })
this.setData({ this.setData({
areas:res.data areas: res.data
}) })
}) })
this.initDate(); this.initDate();
wx.getLocation({ wx.getLocation({
type: 'gcj02', type: 'gcj02',
success:(res)=>{ success: (res) => {
this.setData({ this.setData({
lat:res.latitude, lat: res.latitude,
lon:res.longitude lon: res.longitude
}) })
this.getList() this.getList()
}, },
fail:()=>{ fail: () => {
this.getList() this.getList()
} }
}) })
}, },
changeSort:function(e){ changeSort: function (e) {
let sort = e.currentTarget.dataset.sort; let sort = e.currentTarget.dataset.sort;
this.setData({ this.setData({
sort:this.data.sort==sort?null:sort, sort: this.data.sort == sort ? null : sort,
list:[], list: [],
page:1, page: 1,
isMore:true isMore: true
}) })
if(this.data.sort=='distance' && !this.data.lon){ if (this.data.sort == 'distance' && !this.data.lon) {
wx.getLocation({ wx.getLocation({
type: 'gcj02', type: 'gcj02',
success:(res)=>{ success: (res) => {
this.setData({ this.setData({
lat:res.latitude, lat: res.latitude,
lon:res.longitude lon: res.longitude
}) })
this.getList() this.getList()
}, },
fail:()=>{ fail: () => {
this.getList() this.getList()
} }
}) })
} } else {
else {
this.getList() this.getList()
} }
}, },
changeDateIndex:function(e){ changeDateIndex: function (e) {
this.setData({ this.setData({
dateIndex:e.currentTarget.dataset.index, dateIndex: e.currentTarget.dataset.index,
list:[], list: [],
page:1, page: 1,
isMore:true isMore: true
}) })
this.getList() this.getList()
}, },
changeArea:function(e){ changeArea: function (e) {
this.setData({ this.setData({
areaIndex:e.detail.value, areaIndex: e.detail.value,
list:[], list: [],
page:1, page: 1,
isMore:true isMore: true
}) })
this.getList() this.getList()
}, },
initDate:function(){ initDate: function () {
let today = new Date(util.formatDate(new Date()).replace(/-/g,'/')).getTime(),single = 24 * 60 * 60 *1000,dates=[]; let today = new Date(util.formatDate(new Date()).replace(/-/g, '/')).getTime(),
for(let i=0;i<7;i++){ single = 24 * 60 * 60 * 1000,
let item = new Date(today+i * single); dates = [];
for (let i = 0; i < 7; i++) {
let item = new Date(today + i * single);
let name = this.data.days[item.getDay()] let name = this.data.days[item.getDay()]
if(i==0){ if (i == 0) {
name="今天" name = "今天"
} } else if (i == 1) {
else if(i==1){ name = "明天"
name="明天"
} }
dates.push({ dates.push({
date:util.formatDate(item), date: util.formatDate(item),
dateShort:util.formatDate(item).substr(5,5), dateShort: util.formatDate(item).substr(5, 5),
name:name name: name
}) })
} }
this.setData({ this.setData({
dates:dates dates: dates
}) })
console.log(dates) console.log(dates)
}, },
getList:function(){ getList: function () {
if(!this.data.isMore) return if (!this.data.isMore) return
commonApi._post("Cinema/getCinemaListByShowId",{ commonApi._post("Cinema/getCinemaListByShowId", {
third_id:this.data.id, third_id: this.data.id,
show_date:this.data.dates[this.data.dateIndex].date, show_date: this.data.dates[this.data.dateIndex].date,
city_code:this.data.areas[this.data.areaIndex]?this.data.areas[this.data.areaIndex].area_id:"", city_code: this.data.areas[this.data.areaIndex] ? this.data.areas[this.data.areaIndex].area_id : "",
lon:this.data.lon, lon: this.data.lon,
lat:this.data.lat, lat: this.data.lat,
is_price_sort:this.data.sort=='price'?true:false, is_price_sort: this.data.sort == 'price' ? true : false,
is_distance_sort:this.data.sort=='distance', is_distance_sort: this.data.sort == 'distance',
page:this.data.page, page: this.data.page,
pageSize:10 pageSize: 10
}).then(res=>{ }).then(res => {
res.data.map(item=>{ res.data.map(item => {
if(item.distance>1000){ if (item.distance > 1000) {
item.distanceText = (item.distance/1000).toFixed(2) + 'km'; item.distanceText = (item.distance / 1000).toFixed(2) + 'km';
} } else if (item.distance > 0) {
else if(item.distance>0){
item.distanceText = (item.distance).toFixed(2) + 'm'; item.distanceText = (item.distance).toFixed(2) + 'm';
} }
}) })
let list = this.data.list; let list = this.data.list;
this.setData({ this.setData({
list:list.concat(res.data), list: list.concat(res.data),
page:this.data.page+1 page: this.data.page + 1
}) })
if(res.data.length<10){ if (res.data.length < 10) {
this.setData({ this.setData({
isMore:false isMore: false
}) })
} }
console.log(res) console.log(res)
}) })
}, },
selectMovieSeat(e){ selectMovieSeat(e) {
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/list/movieticket/list/ticket/index?id=' + this.data.id,
title: this.data.title,
type: 'mini'
}).then(res => {
if (res.data.subscribe == 0) {
this.setData({
wxqrcode: res.data.qrcode,
showQrCode: true
})
} else {
let info = e.currentTarget.dataset.info let info = e.currentTarget.dataset.info
let index = e.currentTarget.dataset.index let index = e.currentTarget.dataset.index
console.log(index); console.log(index);
console.log(info.schedules); console.log(info.schedules);
const areaInfo = JSON.parse(info.schedules[index].schedule_area).map(item => ({...item, price:item.areaPrice,areaId:item.seatAreaId})); const areaInfo = JSON.parse(info.schedules[index].schedule_area).map(item => ({
...item,
price: item.areaPrice,
areaId: item.seatAreaId
}));
let planData = { let planData = {
areaInfo, areaInfo,
fee:info.schedules[index].service_fee, fee: info.schedules[index].service_fee,
movieName: this.data.title, movieName: this.data.title,
planId : info.schedules[index].schedule_id, planId: info.schedules[index].schedule_id,
planTime : info.schedules[index].show_time, planTime: info.schedules[index].show_time,
type:'WECHATXCX', type: 'WECHATXCX',
remake : '' remake: ''
} }
let show_id = info.schedules[index].show_id let show_id = info.schedules[index].show_id
let cinema_id = info.schedules[index].cinema_id let cinema_id = info.schedules[index].cinema_id
// let schedule_id = info.schedule_id // let schedule_id = info.schedule_id
console.log(info); console.log(info);
commonApi._post('Cinema/getProductAndSku',{ commonApi._post('Cinema/getProductAndSku', {
show_id, show_id,
cinema_id, cinema_id,
}).then(res=>{ }).then(res => {
app.globalData.product ={ app.globalData.product = {
product:res.data, product: res.data,
info:{ info: {
hallName:info.schedules[index].hall_name, hallName: info.schedules[index].hall_name,
cinemaName:info.title, cinemaName: info.title,
show_date:info.schedules[index].show_date, show_date: info.schedules[index].show_date,
show_time:info.schedules[index].show_time, show_time: info.schedules[index].show_time,
close_time:info.schedules[index].close_time, close_time: info.schedules[index].close_time,
movieName:this.data.title, movieName: this.data.title,
start_end_time:info.schedules[index].show_time, start_end_time: info.schedules[index].show_time,
show_version:info.schedules[index].show_version, show_version: info.schedules[index].show_version,
selectSeatInfo:null, selectSeatInfo: null,
schedule_id:info.schedules[index].schedule_id schedule_id: info.schedules[index].schedule_id
} }
} }
console.log(planData); console.log(planData);
wx.navigateTo({ wx.navigateTo({
url:"/pages/list/movieticket/list/web/index?planData="+ JSON.stringify(planData), url: "/pages/list/movieticket/list/web/index?planData=" + JSON.stringify(planData),
}) })
}) })
}})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成

3
pages/list/movieticket/list/ticket/index.json

@ -1,5 +1,6 @@
{ {
"usingComponents": { "usingComponents": {
"title":"/pages/component/TitleHeader" "title":"/pages/component/TitleHeader",
"code":"../../../../order/components/wxqrCode/index"
} }
} }

2
pages/list/movieticket/list/ticket/index.wxml

@ -44,3 +44,5 @@
<view>暂无内容</view> <view>暂无内容</view>
</view> </view>
</view> </view>
<code showModel="{{showQrCode}}" qrcode = "{{wxqrcode}}">
</code>

42
pages/order/components/wxqrCode/index.js

@ -0,0 +1,42 @@
// pages/order/components/coupon/index.js
let app = getApp()
Component({
/**
* 组件的属性列表
*/
properties: {
showModel:{
type:Boolean,
value:false
},
qrcode:{
type:String,
value:null
}
},
/**
* 组件的初始数据
*/
data: {
},
pageLifetimes: {
show: function() {
console.log(123123);
}
},
/**
* 组件的方法列表
*/
methods: {
submit: function() {
this.setData({
showModel:false
})
}
}
})

4
pages/order/components/wxqrCode/index.json

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

13
pages/order/components/wxqrCode/index.wxml

@ -0,0 +1,13 @@
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModel}}"></view>
<view class="modalDlg" wx:if="{{showModel}}">
<view class="img-box">
<image class="codeImg" src="{{qrcode}}" show-menu-by-longpress="{{true}}"></image>
</view>
<view class="text-box">
扫码关注<text>【君到苏州】</text> 微信公众号
</view>
<view class="more">
查看更多旅游资讯
</view>
<image bindtap="submit" class="close" src="https://static.ticket.sz-trip.com/uploads/20230619/c62511826c880bddc20f98011a87a5a9.png" mode=""/>
</view>

70
pages/order/components/wxqrCode/index.wxss

@ -0,0 +1,70 @@
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.7;
}
.modalDlg{
width: 500rpx;
height: 660rpx;
background-image:url('https://static.ticket.sz-trip.com/uploads/20230619/12a423ee9510a8e5c9c92696e52fcc3c.png') ;
background-size: 100% 100%;
position: fixed;
top: 50%;
left: 0;
z-index: 9999;
margin: -370rpx 125rpx;
background-color: #fff;
border-radius: 36rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.img-box{
width: 300rpx;
height: 300rpx;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin-top: 79rpx;
}
.img-box image{
width: 310rpx;
height: 310rpx;
border-radius: 10rpx;
}
.text-box{
width: 300rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #FFFFFF;
text-align: center;
margin-top: 40rpx;
}
.text-box text{
color: rgba(255, 255, 85, 1);
}
.more{
margin-top: 80rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #0B898E;
}
.close{
position: absolute;
bottom: -120rpx;
left: 50%;
height: 80rpx;
width: 80rpx;
transform: translate(-40rpx,0);
}

9
pages/order/movie/index.wxml

@ -11,11 +11,6 @@
<view>{{product.info.hallName}} <text wx:if="{{product.info.selectSeatInfo}}">{{product.info.selectSeatInfo.seatInfo}}</text></view> <view>{{product.info.hallName}} <text wx:if="{{product.info.selectSeatInfo}}">{{product.info.selectSeatInfo.seatInfo}}</text></view>
</view> </view>
</view> </view>
<view class="tel-box">
<text>手机号码:</text>
<input value="{{tel}}" type="number" bindinput="changeTel" placeholder="输入您的手机号"></input>
</view>
</view> </view>
<view class="tips"> <view class="tips">
@ -32,6 +27,10 @@
</view> </view>
</view> </view>
</view> </view>
<view class="tel-box">
<text>手机号码:</text>
<input value="{{tel}}" type="number" bindinput="changeTel" placeholder="输入您的手机号"></input>
</view>
<coupon money="{{price}}" sku="{{product.product.sku_info.id}}"></coupon> <coupon money="{{price}}" sku="{{product.product.sku_info.id}}"></coupon>

6
pages/order/movie/index.wxss

@ -14,7 +14,7 @@ page {
display: flex; display: flex;
padding-top: 30rpx; padding-top: 30rpx;
padding-bottom: 41rpx; padding-bottom: 41rpx;
border-bottom: 1rpx solid #ccc; /* border-bottom: 1rpx solid #ccc; */
font-size: 27rpx; font-size: 27rpx;
color: #999; color: #999;
justify-content: space-between; justify-content: space-between;
@ -43,6 +43,10 @@ page {
height: 126rpx; height: 126rpx;
font-size: 31rpx; font-size: 31rpx;
justify-content: space-between; justify-content: space-between;
margin: 30rpx 25rpx;
background: white;
border-radius: 9rpx;
padding: 0 20rpx;
} }
.tel-box>text { .tel-box>text {
color: #000; color: #000;

34
pages/user/cartlist/list.js

@ -21,7 +21,9 @@ Page({
productType: '', productType: '',
manageFlag: false, manageFlag: false,
flag: false, //判断订单是否同时有商品和票 flag: false, //判断订单是否同时有商品和票
isCar:'single',//判断是否购物车 isCar: 'single', //判断是否购物车
showQrCode: false,
wxqrcode: null
}, },
/** /**
@ -105,7 +107,7 @@ Page({
} }
}); });
this.setData({ this.setData({
allChecked:flag allChecked: flag
}) })
this.updatePrice() this.updatePrice()
}, },
@ -127,7 +129,7 @@ Page({
commonApi.user_post("cart/update_sku", { commonApi.user_post("cart/update_sku", {
sku_id: item.sku.id, sku_id: item.sku.id,
num: item.num num: item.num
}).then(res => {}) }).then(res => { })
}, },
updatePrice: function () { updatePrice: function () {
let list = this.data.list, let list = this.data.list,
@ -142,6 +144,17 @@ Page({
}) })
}, },
order: function () { order: function () {
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/user/cartlist/list',
title: '购物车',
type: 'mini'
}).then(res => {
if (res.data.subscribe == 0) {
this.setData({
wxqrcode: res.data.qrcode,
showQrCode: true
})
} else {
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
util.pagePoint({ util.pagePoint({
event: 'cart_order' event: 'cart_order'
@ -178,16 +191,16 @@ Page({
if (product.length > 0 && product1.length > 0) { if (product.length > 0 && product1.length > 0) {
this.setData({ this.setData({
flag: 'mix', flag: 'mix',
isCar:'multiple' isCar: 'multiple'
}) })
} }
if ( product1.length > 1) { if (product1.length > 1) {
this.setData({ this.setData({
isCar:'multiple' isCar: 'multiple'
}) })
}else{ } else {
this.setData({ this.setData({
isCar:'single' isCar: 'single'
}) })
} }
console.log(product1); console.log(product1);
@ -205,6 +218,9 @@ Page({
url: '/pages/order/scene/index?isCar=' + this.data.isCar, url: '/pages/order/scene/index?isCar=' + this.data.isCar,
}) })
} }
}
})
}, },
touchStart(e) { //移动前点击的位置 touchStart(e) { //移动前点击的位置
console.log(e) console.log(e)
@ -297,7 +313,7 @@ Page({
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
commonApi.user_post("cart/del_sku", { commonApi.user_post("cart/del_sku", {
sku_id:skuids sku_id: skuids
}).then(res => { }).then(res => {
if (res.code == 1) { if (res.code == 1) {
wx.showToast({ wx.showToast({

3
pages/user/cartlist/list.json

@ -1,5 +1,6 @@
{ {
"usingComponents": { "usingComponents": {
"title": "/pages/component/TitleHeader" "title": "/pages/component/TitleHeader",
"code":"../../order/components/wxqrCode/index"
} }
} }

2
pages/user/cartlist/list.wxml

@ -42,3 +42,5 @@
<text style="color:#666;font-size:26rpx;flex-shrink:0;margin-left:10rpx;flex:1">全选</text> <text style="color:#666;font-size:26rpx;flex-shrink:0;margin-left:10rpx;flex:1">全选</text>
<view class="fixed-btn del-btn" bindtap="delM">删除</view> <view class="fixed-btn del-btn" bindtap="delM">删除</view>
</view> </view>
<code showModel="{{showQrCode}}" qrcode = "{{wxqrcode}}">
</code>
Loading…
Cancel
Save