Myth 4 years ago
parent
commit
9fa29df663
  1. 14
      app.js
  2. 1
      app.json
  3. 2
      app.wxss
  4. 303
      pages/group/info/index.js
  5. 49
      pages/group/info/index.wxml
  6. 63
      pages/group/info/index.wxss
  7. 23
      pages/group/mine/index.js
  8. 4
      pages/group/mine/index.wxml
  9. 73
      pages/index/index.js
  10. 54
      pages/index/index.wxml
  11. 96
      pages/index/index.wxss
  12. 20
      pages/info/hotelProductInfo/index.js
  13. 2
      pages/info/museumInfo/index.js
  14. 2
      pages/info/museumInfo/index.wxml
  15. 19
      pages/info/sceneProductInfo/index.js
  16. 249
      pages/kj/info/index.js
  17. 27
      pages/kj/info/index.wxml
  18. 63
      pages/kj/info/index.wxss
  19. 5
      pages/list/hotel/index.js
  20. 3
      pages/list/hotel/index.wxml
  21. 29
      pages/map/index.js
  22. 1
      pages/order/components/address/index.wxss
  23. 1
      pages/order/components/contact/index.wxss
  24. 2
      pages/order/components/date/index.js
  25. 5
      pages/order/components/date/index.wxml
  26. 9
      pages/order/hotel/index.js
  27. 2
      pages/order/hotel/index.wxml
  28. 9
      pages/order/movie/index.js
  29. 3
      pages/order/movie/index.wxml
  30. 9
      pages/order/postOrder/index.js
  31. 3
      pages/order/postOrder/index.wxml
  32. 9
      pages/order/roadOrder/index.js
  33. 3
      pages/order/roadOrder/index.wxml
  34. 10
      pages/order/scene/index.js
  35. 3
      pages/order/scene/index.wxml
  36. 9
      pages/order/showOrder/index.js
  37. 3
      pages/order/showOrder/index.wxml
  38. 20
      pages/pbService/appreciate/index.js
  39. 16
      pages/user/user.wxml
  40. 96
      pages/user/videoCoupon/index.js
  41. 5
      pages/user/videoCoupon/index.json
  42. 11
      pages/user/videoCoupon/index.wxml
  43. 39
      pages/user/videoCoupon/index.wxss
  44. 2
      project.config.json
  45. 4
      project.private.config.json
  46. 13
      utils/https.js
  47. 2
      utils/util.js

14
app.js

@ -17,6 +17,14 @@ App({
this.globalData.uuid = res.data.uuid;
wx.setStorageSync('uuid', res.data.uuid)
})
// 获取前端配置文件
commonApi._post("pbservice/Other/getClientConfig", {
unique_key: "wechatxcx"
}).then(res => {
let data = JSON.parse(res.data);
data.isTest = data.isTest3;
this.globalData.configJson = data
})
// 获取用户信息
@ -175,7 +183,7 @@ App({
'OFFLINE_WAIT':'线下退款处理中'
},
codeState:['未使用','已使用','已失效','已取消'],
weburl:"https://wechat.b2c.zj-trip.net",
weburl:"",
pay_methods:{
NONE:"无需支付",
WEIXIN:"微信支付",
@ -185,6 +193,8 @@ App({
kjId:null,
gp_id:null,
team_id:null,
retailId:""
retailId:"",
configJson:null,
prizeId:null
}
})

1
app.json

@ -48,6 +48,7 @@
"pages/user/retail/list/index",
"pages/user/retail/order/index",
"pages/user/coupon/index",
"pages/user/videoCoupon/index",
"pages/user/verify/index",
"pages/user/cartlist/list",
"pages/user/couponCenter/index",

2
app.wxss

@ -31,7 +31,7 @@ page{
position: relative;
z-index: 1;
width: 80%;
max-height: 60%;
max-height: 100%;
background: white;
border-radius: 12rpx;
overflow-y: auto;

303
pages/group/info/index.js

@ -2,6 +2,9 @@
import commonApi from "../../../utils/https/common";
let timer = null,app = getApp(),timer2=null;
import util from "../../../utils/util"
import QRCode from '../../../utils/weapp-qrcode.js'
let device = wx.getSystemInfoSync();
const ratio = device.screenWidth / 750;
Page({
/**
@ -14,6 +17,7 @@ Page({
id:null,
isFollow:true,
showRuleFlag:false,
showShareFlag:false,
isOn:false,
myIngList:{}
},
@ -25,15 +29,34 @@ Page({
this.setData({
id:options.id
})
// 获取推荐列表
commonApi.user_post('activity.groups/get_recommend?id='+options.id,{
id:options.id
}).then(res=>{
this.setData({
hot:res.data.data
})
})
commonApi.user_post('activity.groups/detail?id='+options.id+'&team_id='+options.team_id,{
id:options.id,
team_id:options.team_id
}).then(res=>{
this.setData({
info:res.data.detail,
hot:res.data.hotProductList
info:res.data.detail
})
if(res.data.self_team.status==-1){
commonApi.user_post('activity.groups/is_join?id='+options.id,{
id:options.id,
}).then(r=>{
if(r.data.length>0 && r.data[0].status==1){
// 已经参与这个团购
this.setData({
isOn:true,
myIngList:res.data.self_team
})
this.setTime();
this.drawImg()
}
else {
this.setData({
isOn:false
})
@ -47,26 +70,20 @@ Page({
this.setListTime();
})
}
else {
this.setData({
isOn:true,
myIngList:res.data.self_team
})
this.setTime();
}
})
},
// 我的团购结束倒计时
setTime:function(){
let myIngList = this.data.myIngList,time = myIngList.team_list[0].over_time;
if(myIngList.isOver){
let myIngList = this.data.myIngList;
if(myIngList.isOver || !myIngList.team_list || !myIngList.team_list[0]){
if(timer2){
clearTimeout(timer2);
timer2 = null;
}
return;
}
let overTime = new Date(time.replace(/-/g,'/')).getTime(),now = new Date().getTime();
let time = myIngList.team_list[0].over_time,overTime = new Date(time.replace(/-/g,'/')).getTime(),now = new Date().getTime();
if(overTime<=now){
myIngList.isOver=true;
}
@ -95,6 +112,14 @@ Page({
this.setTime()
},1000)
},
// 去详情
gotoInfo(){
util.gotoDetail({
type:this.data.info.type,
id:this.data.info.goods_id,
scene_id:this.data.info.scene_id
})
},
// 列表倒计时
setListTime:function(){
let list = this.data.list,now = new Date();
@ -126,7 +151,7 @@ Page({
clearTimeout(timer);
timer = null;
wx.redirectTo({
url: '/pages/info/groupInfo/index?id='+e.currentTarget.dataset.id
url: '/pages/group/info/index?id='+e.currentTarget.dataset.id
})
},
// 发起团购
@ -138,6 +163,7 @@ Page({
item.maxNum = this.data.info.purchase_quantity;
})
app.globalData.gp_id = this.data.info.id;
console.log(this.data.info)
if(this.data.info.type=='post'){
app.globalData.postProduct = product;
wx.navigateTo({
@ -150,6 +176,12 @@ Page({
url: '/pages/order/scene/index',
})
}
else if(this.data.info.type=="venue"){
app.globalData.product = product[0];
wx.navigateTo({
url: '/pages/order/scene/index?type=museum',
})
}
})
},
// 加入拼团
@ -234,6 +266,249 @@ Page({
})
}
},
// 分享
share:function(){
if(!this.data.shareImg){
wx.showToast({
title: '图片生成中,稍后再试',
icon:'none'
})
return;
}
this.setData({
showShareFlag:!this.data.showShareFlag
})
},
// 保存
save(){
let url = this.data.shareImg,that = this;
wx.authorize({
/* 这个就是保存相册的 */
scope: 'scope.writePhotosAlbum',
success() {
wx.saveImageToPhotosAlbum({
filePath:url,
success(res) {
wx.showToast({
title: '保存成功',
icon:"success"
})
that.setData({
showShareFlag:!this.data.showShareFlag
})
},
fail(res){
wx.showToast({
title: '保存失败',
icon:'none'
})
}
})
},
complete(res) {
console.log(res);
/* 这里判断一下如果没有授权重新打开设置选项 */
wx.getSetting({
success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) {
/* 打开设置的方法 */
// opensit();
wx.showToast({
title: '请打开权限后再试',
icon:'none'
})
}
}
});
}
});
},
// 绘制海报
drawImg:function(){
if(!this.data.myIngList || !this.data.myIngList.team_list || !this.data.myIngList.team_list[0]){
return;
}
var that = this,userinfo = wx.getStorageSync('jstrip_userInfo');
const ctx = wx.createCanvasContext('imageCanvas');
// const device = wx.getSystemInfoSync();
// const ratio = device.screenWidth / 750;
// 先获取到图片信息
let promise2 = new Promise(function(resolve,reject){
wx.getImageInfo({
src:that.data.info.headimg,
success:function(res){
resolve(res);
},
fail:function(res){
reject(res);
}
})
})
let promise3 = new Promise(function(resolve,reject){
let userid = wx.getStorageSync('jstrip_userid')
new QRCode('myQrcode',{
text: 'https://m.cloud.sz-trip.com/GroupDetailFriends?id='+that.data.info.id+'&sharedUserId='+userid+'&channel=-1&team_id='+that.data.myIngList.team_list[0].team_id,
width: 500,
height: 500,
padding: 12, // 生成二维码四周自动留边宽度,不传入默认为0
correctLevel: QRCode.CorrectLevel.L, // 二维码可辨识度
callback: (res) => {
resolve(res);
}
})
})
//成功得到图片信息后,开始绘图
Promise.all([promise2,promise3]).then(imgs=>{
ctx.save();
ctx.beginPath(); //开始绘制
that.handleBorderRect(ctx,0,0,551 * ratio,407 * ratio,25 * ratio,'#ccc')
ctx.clip();//画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因
ctx.drawImage(imgs[0].path, 0, 0,551 * ratio,407 * ratio);
console.log(407 * ratio)
ctx.restore();
ctx.save();
that.handleBorderRect2(ctx,0,407 * ratio,551 * ratio,236*ratio,25 * ratio,'#fff')
ctx.restore();
// 绘制二维码
ctx.drawImage(imgs[1].path, 373 * ratio, 495 * ratio,137 * ratio, 137 * ratio);
// 开始文字绘制
ctx.setFillStyle("#000");
ctx.setFontSize(30 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
that.drawText(ctx,that.data.info.title+that.data.info.sku_name, 25*ratio, 450*ratio,480 * ratio,ratio);
// 售价
ctx.setFillStyle("#D62828");
ctx.setFontSize(40 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
let price = "¥"+(that.data.info.event_price/100);
let width = ctx.measureText(price).width;
ctx.fillText(price, 25*ratio, 620*ratio);
// 副标题
ctx.setFillStyle("#999999");
ctx.setFontSize(28 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
let subtitle = that.data.info.gp_num+'人团';
ctx.fillText(subtitle, 25*ratio, 540*ratio);
// ctx.draw();
// 划线价
ctx.setFillStyle("#999999");
ctx.setFontSize(32 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
let market_price = "¥"+(that.data.info.price/100)
ctx.fillText(market_price, 40*ratio + width, 620*ratio);
let market_price_width = ctx.measureText(market_price).width;
// 划线
ctx.beginPath()
ctx.setLineWidth(1)
ctx.moveTo(40*ratio + width, 608*ratio)
ctx.lineTo(45*ratio + width + market_price_width, 608*ratio)
ctx.stroke();
// 长按识别二维码
// ctx.setFillStyle("#666");
// ctx.setFontSize(22 * ratio); //字大小
// ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
// ctx.fillText("长按识别二维码", 404*ratio, 710*ratio);
// 长按图片转发或保存
// ctx.setFillStyle("#000");
// ctx.setFontSize(24 * ratio); //字大小
// ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
// ctx.fillText("长按图片保存到本地",(592*ratio - ctx.measureText("长按图片保存到本地").width)/2, 740*ratio);
ctx.draw();
// 转为图片
setTimeout(()=>{
wx.canvasToTempFilePath({
x: 0,
y: 0,
canvasId: 'imageCanvas',
success: function (res) {
that.setData({
shareImg:res.tempFilePath
})
},
fail(err){
console.log('agdgjgdajhg',err)
}
})
},500)
return false;
}).catch(err=>{
console.log("this err",err)
})
},
// 圆角矩形
handleBorderRect(ctx, x, y, w, h, r, color){
ctx.beginPath();
ctx.moveTo(x+w,y+h);
ctx.lineTo(x,y+h)
// 左上角
ctx.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI);
ctx.moveTo(x + r, y);
ctx.lineTo(x + w - r, y);
ctx.lineTo(x + w, y + r);
// 右上角
ctx.arc(x + w - r, y + r, r, 1.5 * Math.PI, 2 * Math.PI);
ctx.lineTo(x + w, y + h );
ctx.lineTo(x + w - r, y + h);
ctx.fillStyle = color;
ctx.fill();
ctx.closePath();
},
handleBorderRect2(ctx, x, y, w, h, r, color){
ctx.beginPath();
ctx.moveTo(x,y);
ctx.lineTo(x+w,y)
// 右下角
ctx.arc(x + w - r, y + h - r, r, 0, 0.5 * Math.PI);
ctx.lineTo(x + r, y + h);
ctx.lineTo(x, y + h - r);
// 左下角
ctx.arc(x + r, y + h - r, r, 0.5 * Math.PI, Math.PI);
ctx.lineTo(x, y);
ctx.lineTo(x, y);
ctx.fillStyle = color;
ctx.fill();
ctx.closePath();
},
// 绘制两行文字
drawText: function(ctx, str, x, y, canvasWidth,ratio) {
let row = [],temp="",chr=str.split("");
for (var a = 0; a < chr.length; a++) {
if (ctx.measureText(temp).width < canvasWidth) {
temp += chr[a];
}
else {
a--; //这里添加了a-- 是为了防止字符丢失,效果图中有对比
row.push(temp);
temp = "";
}
}
row.push(temp);
//如果数组长度大于2 则截取前两个
if (row.length > 2) {
var rowCut = row.slice(0, 2);
var rowPart = rowCut[1];
var test = "";
var empty = [];
for (var a = 0; a < rowPart.length; a++) {
if (ctx.measureText(test).width < canvasWidth - 30 * ratio) {
test += rowPart[a];
}
else {
break;
}
}
empty.push(test);
var group = empty[0] + "..."//这里只显示两行,超出的用...表示
rowCut.splice(1, 1, group);
row = rowCut;
}
for (var b = 0; b < row.length; b++) {
ctx.fillText(row[b], x, y + b * 40 * ratio, canvasWidth);
}
},
/**
* 生命周期函数--监听页面初次渲染完成
@ -294,7 +569,7 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function (e) {
if(e.from=='button' || this.data.myIngList.status==1){
if(e.from=='button' || this.data.isOn){
return {
title: "我正在发起团购,快来参加吧", // 默认是小程序的名称(可以写slogan等)
path: "/pages/group/info/index?id="+this.data.info.id+'&team_id='+this.data.myIngList.team_list[0].team_id, // 默认是当前页面,必须是以‘/’开头的完整路径

49
pages/group/info/index.wxml

@ -14,7 +14,7 @@
<view class="old-price">¥{{info.price/100}}</view>
</view>
</view>
<navigator url="/pages/info/{{info.type=='post'?'post':'scene'}}ProductInfo/index?id={{info.goods_id}}" class="info-btn">详情 ></navigator>
<view bindtap="gotoInfo" class="info-btn">详情 ></view>
</view>
<!-- 进行中的拼团 -->
<view wx:if="{{isOn && myIngList && myIngList.status==1}}">
@ -31,10 +31,10 @@
<view class="time-box headimglist">
<image wx:for="{{myIngList.team_list}}" src="{{item.avatar}}" mode="aspectFill"></image>
<view>
<button open-type="share" plain="true" style="border:none;padding:0;margin:0;"><image style="margin-right:0" src="https://resources.jszhwlpt.com/ffece698-001a-42be-8d8c-ff86985818e3.png" mode="aspectFill"></image></button>
<button bindtap="share" plain="true" style="border:none;padding:0;margin:0;"><image style="margin-right:0" src="https://resources.jszhwlpt.com/ffece698-001a-42be-8d8c-ff86985818e3.png" mode="aspectFill"></image></button>
</view>
</view>
<button open-type="share" plain="true" class="yq-btn">邀请好友</button>
<button bindtap="share" plain="true" class="yq-btn">邀请好友</button>
</view>
<!-- 失败的拼团 -->
<view class="fail-box" wx:if="{{info.productDetail.status==0 && info.isGroupPurchasing==1}}">
@ -68,10 +68,10 @@
</view>
<view style="margin-top:30rpx" bindtap="showRule">拼团规则</view>
<view class="group-list">
<view class="group-item" wx:for="{{list}}">
<view class="group-item" wx:for="{{list}}" wx:if="{{item.is_team==1}}">
<image src="{{item.avatar}}" mode="aspectFill"></image>
<view class="nickname">{{item.nickname}}</view>
<view class="group-num">还差<text>{{info.gp_num - item.team_num}}</text>人</view>
<view class="group-num">还差<text>{{item.team_num}}</text>人</view>
<view class="btn-box" bindtap="join" data-item="{{item}}">
<view class="btn-top">参团</view>
<view class="btn-time">剩余{{item.h}}:{{item.m}}:{{item.s}}</view>
@ -88,28 +88,45 @@
</view>
<view class="hot-list" wx:if="{{hot.length>0}}">
<view class="hot-item" wx:for="{{hot}}" bindtap="gotoDetail" data-id="{{item.id}}">
<image src="{{item.headImg}}" mode="apsectFill"></image>
<image src="{{item.headimg}}" mode="apsectFill"></image>
<view class="hot-info">
<view class="hot-title1">{{item.productName+item.skuName}}</view>
<view class="hot-title1">{{item.title+item.sku_name}}</view>
<view class="hot-bottom">
<text>¥{{item.eventPrice/100}}</text>
<text>¥{{item.event_price/100}}</text>
<view class="old-price">¥{{item.price/100}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="mask" wx:if="{{showShareFlag}}">
<view class="mask-bg" bindtap="hideShare"></view>
<view class="mask-content" style="width:500rpx;overflow:hidden;text-align:center;color:#FF9124;padding:40rpx 0;">
<view>请先关注公众号</view>
<image bindlongpress="saveImg" style="width:260rpx;height:260rpx;display:block;margin:40rpx auto;border-radius:10rpx;border:1rpx solid" src="https://resources.jszhwlpt.com/d3c2d106-b893-474f-bf5c-091bd04f247f.jpeg" mode="aspectFill" class="codeimg"></image>
<view style="color:#333">长按保存二维码</view>
</view>
</view>
<view class="mask" wx:if="{{info && showRuleFlag}}">
<view class="mask-bg" bindtap="showRule"></view>
<view class="mask-content" style="padding:20rpx;max-height:50%;overflow-y:auto;min-height:30%;">
<rich-text nodes="{{info.rule_content}}"></rich-text>
</view>
</view>
<view style="position:absolute;right:0;left:-10000rpx;top:-20000rpx;z-index:-1">
<canvas canvas-id='imageCanvas' class='imageCanvas' style="width:551rpx;height:643rpx;" disable-scroll='true'>
</canvas>
<canvas class="canvasCode" style="opacity:0;width:500px;height:500px" canvas-id="myQrcode"></canvas>
</view>
<view class="mask" wx:if="{{showShareFlag}}" style="align-items: center;">
<view class="mask-bg" bindtap="share"></view>
<view class="mask-content share-img-box">
<image class="share-img" src="{{shareImg}}" mode="widthFix"></image>
<view class="share-tips">
<view style="position:relative">
<image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/img.png" mode="widthFix"></image>
<view>保存图片到相册</view>
<view class="tipimg"><image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok.png" mode="widthFix"></image></view>
</view>
<image style="width:36rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/arrow2.png" mode="widthFix"></image>
<view style="position:relative">
<image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/code.png" mode="widthFix"></image>
<view>微信识别二维码</view>
<view class="tipimg"><image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok1.png" mode="widthFix"></image></view>
</view>
</view>
<view class="save-btn" bindtap="save">保存到相册</view>
</view>
</view>

63
pages/group/info/index.wxss

@ -327,3 +327,66 @@ button {
line-height: 30rpx;
color: #666;
}
.share-img-box {
/* width: 551rpx; */
position: static;
background: none;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.share-img {
display: block;
width: 551rpx;
}
.share-tips {
width: 426rpx;
height: 150rpx;
background: #FFFFFF;
border-radius: 25rpx;
margin-top: 25rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 65rpx;
color: #999;
font-size: 24rpx;
text-align: center;
line-height: 40rpx;
}
.share-tips .img {
display: block;
width: 55rpx;
margin: 0 auto;
margin-bottom: 4rpx;
}
.tipimg {
position: absolute;
left: 50%;
margin-left: 16rpx;
width: 24rpx;
height: 24rpx;
background: #D62828;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
top: 34rpx;
}
.tipimg image {
width: 21rpx;
display: block;
}
.save-btn {
width: 403rpx;
line-height: 77rpx;
background: #D62828;
border-radius: 39rpx;
text-align: center;
color: #fff;
font-size: 31rpx;
font-weight: 500;
margin-top: 50rpx;
}

23
pages/group/mine/index.js

@ -1,6 +1,7 @@
// pages/user/pdd/index.js
import productApi from "../../../utils/https/common";
let timer = null,app = getApp();
import util from "../../../utils/util"
Page({
/**
@ -149,18 +150,32 @@ Page({
})
},
goOrder:function(e){
wx.navigateTo({
url: '/pages/info/orderInfo/index?id='+e.currentTarget.dataset.item.gpChildOrderNo,
})
let item = e.currentTarget.dataset.item,info = {
order_id:item.order_id,
order_product_list:[{
product_model:item.type
}]
}
util.gotoOrder(info)
// wx.navigateTo({
// url: '/pages/info/orderInfo/index?id='+.gpChildOrderNo,
// })
},
refund(e){
let that = this;
wx.showModal({
title:"提示",
content:"确定申请退款吗?",
success:function(res){
if(res.confirm){
// todo
productApi.user_post({})
productApi.user_post('order/refund',{
order_id:e.currentTarget.dataset.item.order_id
}).then(res=>{
if(res && res.code==1){
that.getList()
}
})
}
}
})

4
pages/group/mine/index.wxml

@ -27,9 +27,9 @@
<view class="item-bottom" wx:if="{{type==2}}">
<view class="info-btn info-btn-new" catchtap="goOrder" data-item="{{item}}">查看订单</view>
</view>
<!-- <view class="item-bottom" wx:else>
<view class="item-bottom" wx:else>
<view class="info-btn info-btn-new" catchtap="refund" data-item="{{item}}">退款</view>
</view> -->
</view>
</view>
<view class="list-title" wx:if="{{type==1 && list.joinList.length>0 || type==2 && over.joinList.length>0}}">我参与的</view>
<view class="item" wx:for="{{type==1?list.joinList:over.joinList}}" bindtap="gotoDetail" data-item="{{item}}">

73
pages/index/index.js

@ -27,7 +27,9 @@ Page({
lat:"",
lon:"",
urltopage:{},
scrollLeft:0
scrollLeft:0,
videoPrize:false,
prizeInfo:null
},
onLoad: function (options) {
if(options.from){
@ -48,22 +50,12 @@ Page({
this.getList()
}
})
this.setData({
height:height,
padHeight:systemInfo.statusBarHeight,
right:(systemInfo.screenWidth - rect.right) + rect.width
})
commonApi._post("pbservice/Other/getClientConfig",{
unique_key:"wechatxcx"
}).then(res=>{
let data = JSON.parse(res.data)
this.setData({
indexHot:data.indexHot,
isTest:data.isTest
})
this.getFourProduct()
})
commonApi._post("pbservice/Other/getClientConfig",{
unique_key:"urltopage"
}).then(res=>{
@ -81,7 +73,7 @@ Page({
month:(this.data.months[today.getMonth()]).toUpperCase(),
date:today.getDate()
})
this.getVideoPrize()
},
onTabItemTap:function(e){
console.log(e,99999999)
@ -460,11 +452,64 @@ Page({
},
// 监听文旅查询的scroll
listenScroll(e){
console.log(e)
this.setData({
scrollLeft:e.detail.scrollLeft
})
},
// 获取短视频大赛是否中奖 中奖详情
getVideoPrize(){
let user_id = wx.getStorageSync('jstrip_userid');
if(!user_id || wx.getStorageSync('indexPriceNoTip')) return;
commonApi.user_post('actonline/video_act/getRaffle',{
act_id:5
}).then(res=>{
this.setData({
videoPrize:res.data
})
})
},
noMoreTip(){
wx.setStorageSync('indexPriceNoTip', true)
this.closePrice()
},
closePrice(){
this.setData({
videoPrize:false,
prizeInfo:null
})
},
// 抽奖
choosePrize(){
commonApi.user_post('actonline/video_act/luckyDraw',{
act_id:5
}).then(res=>{
this.setData({
prizeInfo:res.data
})
if(res.data.type!='none'){
// 抽奖成功的话 弹框
wx.showModal({
title:"提示",
content:"中奖人员请联系君到苏州客服,领奖方式以客服通知为准",
showCancel:false
})
}
})
},
onReady:function(){
if(app.globalData.configJson){
this.setData({
indexHot:app.globalData.configJson.indexHot,
isTest:app.globalData.configJson.isTest
})
this.getFourProduct()
}
else {
setTimeout(()=>{
this.onReady()
},300)
}
},
/**
* 用户点击右上角分享

54
pages/index/index.wxml

@ -104,8 +104,8 @@
</image>
<view class="sale-info">
<view class="sale-product-title textOver2">
<view>带你轻松</view>
<view>玩转苏州</view>
<view>四季苏州</view>
<view>最是江南</view>
</view>
<view class="sale-price" style="color:rgb(0, 153, 137)" wx:if="{{roadProduct}}">¥{{roadProduct.price?roadProduct.price/100:0}}起</view>
</view>
@ -332,3 +332,53 @@
<view wx:if="{{listMore && isTest==false}}" class="more-btn-text" bindtap="getList">查看更多</view>
<view wx:else class="more-btn-text" bindtap="getList">暂无更多推荐</view>
</view>
<view class="mask prizeMask" wx:if="{{videoPrize}}">
<view class="mask-bg"></view>
<view class="mask-content" style="width:100%;display:flex;flex-direction:column;background:none;border-radius:0;align-items:center">
<!-- 中奖的卡券 -->
<view style="position:relative" wx:if="{{prizeInfo && prizeInfo.type=='coupon'}}">
<image bindtap="choosePrize" style="display:block;width:533rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/bg1.png" mode="widthFix"></image>
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/congratulation.png" mode="widthFix" class="prize-tip-text"></image>
<view class="prize-name">{{prizeInfo.prize_name}}</view>
<view class="prize-img">
<image src="{{prizeInfo.head_img}}" mode="aspectFill"></image>
</view>
<!-- <view class="btn-box">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/btnbg.png" mode="widthFix"></image>
<navigator url="/pages/user/videoCoupon/index">前往查看</navigator>
</view> -->
</view>
<!-- 中奖的产品 -->
<view style="position:relative" wx:elif="{{prizeInfo && prizeInfo.type=='product'}}">
<image bindtap="choosePrize" style="display:block;width:533rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/bg1.png" mode="widthFix"></image>
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/congratulation.png" mode="widthFix" class="prize-tip-text"></image>
<view class="prize-name">{{prizeInfo.prize_name}}</view>
<view class="prize-img">
<image src="{{prizeInfo.head_img}}" mode="aspectFill"></image>
</view>
<!-- <view class="btn-box">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/btnbg.png" mode="widthFix"></image>
<navigator url="/pages/user/videoCoupon/index">前往查看</navigator>
</view> -->
</view>
<!-- 未中奖 -->
<view style="position:relative" wx:elif="{{prizeInfo && prizeInfo.type=='none'}}">
<image bindtap="choosePrize" style="display:block;width:533rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/bg1.png" mode="widthFix"></image>
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/sorrytext.png" mode="widthFix" class="prize-tip-text"></image>
<view class="prize-name">您与奖品擦肩而过期待下次参与</view>
<view class="prize-img">
<image src="{{prizeInfo.head_img}}" mode="aspectFill"></image>
</view>
<view class="btn-box">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/btnbg.png" mode="widthFix"></image>
<view bindtap="closePrice">我知道了</view>
</view>
</view>
<!-- 未抽奖状态 -->
<view style="position:relative" wx:else>
<image bindtap="choosePrize" style="display:block;width:533rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/allbg.png" mode="widthFix"></image>
<view class="nomore-tip-btn" bindtap="noMoreTip"></view>
</view>
<image bindtap="closePrice" style="width:80rpx;margin-top:40rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/videoprize/allclose.png" mode="widthFix"></image>
</view>
</view>

96
pages/index/index.wxss

@ -488,3 +488,99 @@
border-radius: 3rpx;
background: #0B898E;
}
.nomore-tip-btn {
position: absolute;
left: 0;
right: 0;
height: 78rpx;
bottom: 0;
}
.prize-tip-text {
width: 267rpx;
display: block;
top: 39rpx;
left: 134rpx;
position: absolute;
}
.prize-name {
position: absolute;
text-align: center;
left: 132rpx;
right: 132rpx;
top: 169rpx;
font-size: 31rpx;
color: #333333;
}
.prize-img {
width: 333rpx;
height: 240rpx;
border-radius: 13rpx;
overflow: hidden;
position: absolute;
left: 100rpx;
display: flex;
align-items: center;
justify-content: center;
top: 269rpx;
}
.prize-img image {
display: block;
width: 333rpx;
height: 240rpx;
}
.btn-box {
position: absolute;
width: 400rpx;
height: 87rpx;
left: 67rpx;
bottom: 78rpx;
text-align: center;
line-height: 87rpx;
}
.btn-box image {
display: block;
width: 100%;
}
.btn-box navigator,.btn-box view {
color: #fff;
font-size: 35rpx;
font-weight: bold;
position: absolute;
left: 0;
top: 0;
z-index: 1;
right: 0;
}
.prize-coupon {
width: 293rpx;
height: 227rpx;
position: absolute;
top: 274rpx;
left: 120rpx;
color: #fff;
font-size: 24rpx;
text-align: center;
}
.prize-coupon image {
display: block;
width: 100%;
}
.prize-coupon-money {
position: absolute;
left: 0;
right: 0;
font-size: 80rpx;
font-weight: bold;
line-height: 110rpx;
top: 12rpx;
}
.prize-coupon-money::before{
content: "¥";
font-size: 32rpx;
}
.prize-coupon-tip {
position: absolute;
left: 0;
right: 0;
top: 120rpx;
}

20
pages/info/hotelProductInfo/index.js

@ -52,14 +52,7 @@ Page({
retailId: options.retailId
})
}
commonApi._post("pbservice/Other/getClientConfig", {
unique_key: "wechatxcx"
}).then(res => {
let data = JSON.parse(res.data);
this.setData({
isTest: data.isTest
})
})
// 先初始化日期
let today = new Date(), tomorrow = new Date(today.getTime() + 24 * 60 * 60 * 1000);
this.setData({
@ -574,7 +567,16 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
if(app.globalData.configJson){
this.setData({
isTest: app.globalData.configJson.isTest
})
}
else {
setTimeout(()=>{
this.onReady()
},300)
}
},
/**

2
pages/info/museumInfo/index.js

@ -410,7 +410,7 @@ Page({
infoDate: this.data.date,
infoTime: this.data.time,
isGroup: this.data.isGroup,
isTeam: this.data.info.team_order
isTeam: this.data.info.team_order && this.data.isGroup?1:0
}
wx.navigateTo({
url: '/pages/order/scene/index?type=museum'

2
pages/info/museumInfo/index.wxml

@ -30,7 +30,7 @@
<view style="height:102rpx;" wx:if="{{fixed}}"></view>
<view id="content">
<view wx:if="{{type==1}}">
<date wx:if="{{isLogin && product && product.sku && product.product}}" bind:onChangeDate="changeDate"
<date wx:if="{{isLogin && product && product.sku && product.product && info}}" bind:onChangeDate="changeDate"
bind:onChangeTime="changeTime" product="{{product}}" isTeam="{{info.team_order && isGroup}}"></date>
<view class="detail-title">预订须知</view>
<rich-text wx:if="{{info}}" class="detail" nodes="{{tool.formateRichText(info.book_info)}}"></rich-text>

19
pages/info/sceneProductInfo/index.js

@ -37,14 +37,6 @@ Page({
retailId: options.retailId
})
}
commonApi._post("pbservice/Other/getClientConfig", {
unique_key: "wechatxcx"
}).then(res => {
let data = JSON.parse(res.data);
this.setData({
isTest: data.isTest
})
})
this.setData({
id: options.id
})
@ -458,7 +450,16 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
if(app.globalData.configJson){
this.setData({
isTest: app.globalData.configJson.isTest
})
}
else {
setTimeout(()=>{
this.onReady()
},300)
}
},
/**

249
pages/kj/info/index.js

@ -3,6 +3,9 @@ import productApi from "../../../utils/https/common";
import util from "../../../utils/util"
let app = getApp();
let timer = null;
import QRCode from '../../../utils/weapp-qrcode.js'
let device = wx.getSystemInfoSync();
const ratio = device.windowWidth / 750;
Page({
/**
@ -51,6 +54,7 @@ Page({
this.setData({
isKj:false
})
this.drawImg()
}
else {
this.setData({
@ -168,12 +172,6 @@ Page({
info:info
})
},
// 隐藏关注二维码
hideShare:function(){
this.setData({
showShareFlag:false
})
},
// 保存二维码到手机
saveImg:function(){
wx.downloadFile({
@ -192,6 +190,245 @@ Page({
showRuleFlag:!this.data.showRuleFlag
})
},
// 分享
share:function(){
if(!this.data.shareImg){
wx.showToast({
title: '图片生成中,稍后再试',
icon:'none'
})
return;
}
this.setData({
showShareFlag:!this.data.showShareFlag
})
},
// 保存
save(){
let url = this.data.shareImg,that = this;
wx.authorize({
/* 这个就是保存相册的 */
scope: 'scope.writePhotosAlbum',
success() {
wx.saveImageToPhotosAlbum({
filePath:url,
success(res) {
wx.showToast({
title: '保存成功',
icon:"success"
})
that.setData({
showShareFlag:!this.data.showShareFlag
})
},
fail(res){
wx.showToast({
title: '保存失败',
icon:'none'
})
}
})
},
complete(res) {
console.log(res);
/* 这里判断一下如果没有授权重新打开设置选项 */
wx.getSetting({
success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) {
/* 打开设置的方法 */
// opensit();
wx.showToast({
title: '请打开权限后再试',
icon:'none'
})
}
}
});
}
});
},
// 绘制海报
drawImg:function(){
var that = this,userinfo = wx.getStorageSync('jstrip_userInfo');
const ctx = wx.createCanvasContext('imageCanvas');
// const device = wx.getSystemInfoSync();
// const ratio = device.screenWidth / 750;
// 先获取到图片信息
let promise2 = new Promise(function(resolve,reject){
wx.getImageInfo({
src:that.data.info.detail.headimg,
success:function(res){
resolve(res);
},
fail:function(res){
reject(res);
}
})
})
let promise3 = new Promise(function(resolve,reject){
let userid = wx.getStorageSync('jstrip_userid')
new QRCode('myQrcode',{
text: 'https://m.cloud.sz-trip.com/BargainFriends?id='+that.data.info.detail.id+'&sharedUserId='+userid+'&channel=-1&originate_id='+that.data.kjId,
width: 500,
height: 500,
padding: 12, // 生成二维码四周自动留边宽度,不传入默认为0
correctLevel: QRCode.CorrectLevel.L, // 二维码可辨识度
callback: (res) => {
resolve(res);
}
})
})
//成功得到图片信息后,开始绘图
Promise.all([promise2,promise3]).then(imgs=>{
ctx.save();
ctx.beginPath(); //开始绘制
that.handleBorderRect(ctx,0,0,551 * ratio,407 * ratio,25 * ratio,'#ccc')
ctx.clip();//画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因
ctx.drawImage(imgs[0].path, 0, 0,551 * ratio,407 * ratio);
ctx.restore();
ctx.save();
that.handleBorderRect2(ctx,0,407 * ratio,551 * ratio,236*ratio,25 * ratio,'#fff')
ctx.restore();
// 绘制二维码
ctx.drawImage(imgs[1].path, 373 * ratio, 495 * ratio,137 * ratio, 137 * ratio);
// 开始文字绘制
ctx.setFillStyle("#000");
ctx.setFontSize(30 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
that.drawText(ctx,that.data.info.detail.title+that.data.info.detail.sku_name, 25*ratio, 450*ratio,480 * ratio,ratio);
// 售价
ctx.setFillStyle("#D62828");
ctx.setFontSize(40 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
let price = "¥0";
let width = ctx.measureText(price).width;
ctx.fillText(price, 25*ratio, 620*ratio);
// 副标题
ctx.setFillStyle("#999999");
ctx.setFontSize(28 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
let subtitle = '快来帮我砍一刀吧~'
ctx.fillText(subtitle, 25*ratio, 540*ratio);
// ctx.draw();
// 划线价
ctx.setFillStyle("#999999");
ctx.setFontSize(32 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
let market_price = "¥"+(that.data.info.detail.kj_money/100)
ctx.fillText(market_price, 40*ratio + width, 620*ratio);
let market_price_width = ctx.measureText(market_price).width;
// 划线
ctx.beginPath()
ctx.setLineWidth(1)
ctx.moveTo(40*ratio + width, 608*ratio)
ctx.lineTo(45*ratio + width + market_price_width, 608*ratio)
ctx.stroke();
// 长按识别二维码
// ctx.setFillStyle("#666");
// ctx.setFontSize(22 * ratio); //字大小
// ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
// ctx.fillText("长按识别二维码", 404*ratio, 710*ratio);
// 长按图片转发或保存
// ctx.setFillStyle("#000");
// ctx.setFontSize(24 * ratio); //字大小
// ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
// ctx.fillText("长按图片保存到本地",(592*ratio - ctx.measureText("长按图片保存到本地").width)/2, 740*ratio);
ctx.draw();
// 转为图片
setTimeout(()=>{
wx.canvasToTempFilePath({
x: 0,
y: 0,
canvasId: 'imageCanvas',
success: function (res) {
that.setData({
shareImg:res.tempFilePath
})
},
fail(err){
console.log('agdgjgdajhg',err)
}
})
},500)
return false;
}).catch(err=>{
console.log("this err",err)
})
},
// 圆角矩形
handleBorderRect(ctx, x, y, w, h, r, color){
ctx.beginPath();
ctx.moveTo(x+w,y+h);
ctx.lineTo(x,y+h)
// 左上角
ctx.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI);
ctx.moveTo(x + r, y);
ctx.lineTo(x + w - r, y);
ctx.lineTo(x + w, y + r);
// 右上角
ctx.arc(x + w - r, y + r, r, 1.5 * Math.PI, 2 * Math.PI);
ctx.lineTo(x + w, y + h );
ctx.lineTo(x + w - r, y + h);
ctx.fillStyle = color;
ctx.fill();
ctx.closePath();
},
handleBorderRect2(ctx, x, y, w, h, r, color){
ctx.beginPath();
ctx.moveTo(x,y);
ctx.lineTo(x+w,y)
// 右下角
ctx.arc(x + w - r, y + h - r, r, 0, 0.5 * Math.PI);
ctx.lineTo(x + r, y + h);
ctx.lineTo(x, y + h - r);
// 左下角
ctx.arc(x + r, y + h - r, r, 0.5 * Math.PI, Math.PI);
ctx.lineTo(x, y);
ctx.lineTo(x, y);
ctx.fillStyle = color;
ctx.fill();
ctx.closePath();
},
// 绘制两行文字
drawText: function(ctx, str, x, y, canvasWidth,ratio) {
let row = [],temp="",chr=str.split("");
for (var a = 0; a < chr.length; a++) {
if (ctx.measureText(temp).width < canvasWidth) {
temp += chr[a];
}
else {
a--; //这里添加了a-- 是为了防止字符丢失,效果图中有对比
row.push(temp);
temp = "";
}
}
row.push(temp);
//如果数组长度大于2 则截取前两个
if (row.length > 2) {
var rowCut = row.slice(0, 2);
var rowPart = rowCut[1];
var test = "";
var empty = [];
for (var a = 0; a < rowPart.length; a++) {
if (ctx.measureText(test).width < canvasWidth - 30 * ratio) {
test += rowPart[a];
}
else {
break;
}
}
empty.push(test);
var group = empty[0] + "..."//这里只显示两行,超出的用...表示
rowCut.splice(1, 1, group);
row = rowCut;
}
for (var b = 0; b < row.length; b++) {
ctx.fillText(row[b], x, y + b * 40 * ratio, canvasWidth);
}
},
/**
* 生命周期函数--监听页面初次渲染完成

27
pages/kj/info/index.wxml

@ -52,7 +52,7 @@
<!-- 砍价已发起未结束的时候 -->
<view wx:if="{{isKj==false && info.user_record && info.user_record.flag=='ing'}}">
<view class="info-btns" style="border:none">
<button class="info-btn-kan" open-type="share">喊好友砍一刀</button>
<button class="info-btn-kan" bindtap="share">喊好友砍一刀</button>
</view>
<view class="faqi-tip" wx:if="{{info.detail.success_need_num}}">预计再邀请<text style="color:#E14135;font-size:30rpx;font-weight:bold;margin:0 5rpx">{{info.detail.success_need_num}}</text>人后砍价完成</view>
<view class="buy-tip" bindtap="gotoDetail" data-type="none">原价购买 >></view>
@ -107,3 +107,28 @@
<view style="color:#333">长按保存二维码</view>
</view>
</view>
<view style="position:absolute;right:0;left:-10000rpx;top:-20000rpx;z-index:-1">
<canvas canvas-id='imageCanvas' class='imageCanvas' style="width:551rpx;height:643rpx;" disable-scroll='true'>
</canvas>
<canvas class="canvasCode" style="opacity:0;width:500px;height:500px" canvas-id="myQrcode"></canvas>
</view>
<view class="mask" wx:if="{{showShareFlag}}" style="align-items: center;">
<view class="mask-bg" bindtap="share"></view>
<view class="mask-content share-img-box">
<image class="share-img" src="{{shareImg}}" mode="widthFix"></image>
<view class="share-tips">
<view style="position:relative">
<image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/img.png" mode="widthFix"></image>
<view>保存图片到相册</view>
<view class="tipimg"><image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok.png" mode="widthFix"></image></view>
</view>
<image style="width:36rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/arrow2.png" mode="widthFix"></image>
<view style="position:relative">
<image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/code.png" mode="widthFix"></image>
<view>微信识别二维码</view>
<view class="tipimg"><image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok1.png" mode="widthFix"></image></view>
</view>
</view>
<view class="save-btn" bindtap="save">保存到相册</view>
</view>
</view>

63
pages/kj/info/index.wxss

@ -239,3 +239,66 @@ page {
color: #E14135;
text-align: center;
}
.share-img-box {
/* width: 551rpx; */
position: static;
background: none;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.share-img {
display: block;
width: 551rpx;
}
.share-tips {
width: 426rpx;
height: 150rpx;
background: #FFFFFF;
border-radius: 25rpx;
margin-top: 25rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 65rpx;
color: #999;
font-size: 24rpx;
text-align: center;
line-height: 40rpx;
}
.share-tips .img {
display: block;
width: 55rpx;
margin: 0 auto;
margin-bottom: 4rpx;
}
.tipimg {
position: absolute;
left: 50%;
margin-left: 16rpx;
width: 24rpx;
height: 24rpx;
background: #D62828;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
top: 34rpx;
}
.tipimg image {
width: 21rpx;
display: block;
}
.save-btn {
width: 403rpx;
line-height: 77rpx;
background: #D62828;
border-radius: 39rpx;
text-align: center;
color: #fff;
font-size: 31rpx;
font-weight: 500;
margin-top: 50rpx;
}

5
pages/list/hotel/index.js

@ -7,7 +7,7 @@ Page({
* 页面的初始数据
*/
data: {
type:5,
type:8,
total:1,
list:[],
keywords:"",
@ -104,7 +104,8 @@ Page({
lon:this.data.location?this.data.location.lon:null,
lat:this.data.location?this.data.location.lat:null,
sort:this.data.isDistanceSort?'distance':null,
order:this.data.isDistanceSort?'asc':null
order:this.data.isDistanceSort?'asc':null,
wid:'1'
}).then(res=>{
res.data.list.map(item=>{
if(item.distance>=1000){

3
pages/list/hotel/index.wxml

@ -5,10 +5,11 @@
<image src="https://static.ticket.sz-trip.com/xcxImages/listtop/hotel1.png" class="hotelimg" mode="widthFix"></image>
</view>
<view class="hotel-types">
<view class="hotel-type{{type==8?' active':''}}" bindtap="changeType" data-type="8">特色民宿</view>
<view class="hotel-type{{type==5?' active':''}}" bindtap="changeType" data-type="5">精品酒店</view>
<view class="hotel-type{{type==6?' active':''}}" bindtap="changeType" data-type="6">舒适酒店</view>
<view class="hotel-type{{type==7?' active':''}}" bindtap="changeType" data-type="7">经济连锁</view>
<view class="hotel-type{{type==8?' active':''}}" bindtap="changeType" data-type="8">特色民宿</view>
</view>
<view class="sort-btn" style="{{isDistanceSort?'':'color:#333'}}">
<view bindtap="changeSort">距离排序</view>

29
pages/map/index.js

@ -58,25 +58,32 @@ Page({
longitude:r.longitude,
latitude:r.latitude
})
that.getIsTest()
},
fail(){
that.getIsTest()
}
})
commonApi._post("pbservice/Other/getClientConfig",{
unique_key:"wechatxcx"
}).then(res=>{
let data = JSON.parse(res.data)
})
},
getIsTest(){
if(app.globalData.configJson){
this.setData({
indexHot:data.indexHot,
isTest:data.isTest
isTest:app.globalData.configJson.isTest
})
if(data.isTest==true){
if(app.globalData.configJson.isTest==true){
this.setData({
type:1
})
}
that.getList()
})
})
this.getList()
}
else {
setTimeout(()=>{
this.getIsTest()
},200)
}
},
gotoDetail:function(){
if(this.data.info.info.type=='relic'){

1
pages/order/components/address/index.wxss

@ -85,6 +85,7 @@
padding: 0 25rpx;
overflow-y: auto;
background: #F7F7F7;
max-height: 50%;
}
.linkmanlist-item {
background: white;

1
pages/order/components/contact/index.wxss

@ -83,6 +83,7 @@
padding: 0 25rpx;
overflow-y: auto;
background: #F7F7F7;
max-height: 50%;
}
.linkmanlist-item {
background: white;

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

@ -202,7 +202,7 @@ Component({
})
},
selectTime: function (e) {
if (this.data.timelist[e.currentTarget.dataset.index].stock_number != 0) {
if (this.data.timelist[e.currentTarget.dataset.index].stock_number >0) {
this.setData({
timeIndex: e.currentTarget.dataset.index
})

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

@ -4,7 +4,8 @@
<view class="dates-boxes">
<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="{{threeDays}}">
<view>{{item.date}}</view>
<view class="price" wx:if="{{ !isTeam && item.stock!=0 && item.stock!=null && item.price!=null}}">{{item.price==0 || kjIdCom?'免费':('¥'+item.price/100)}}</view>
<view class="price" wx:if="{{ !isTeam && item.stock==-1}}">不开放</view>
<view class="price" wx:elif="{{ !isTeam && item.stock!=0 && item.stock!=null && item.price!=null}}">{{item.price==0 || kjIdCom?'免费':('¥'+item.price/100)}}</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>
@ -17,7 +18,7 @@
</view>
</view>
<view class="date-times" wx:if="{{timelist.length>0}}">
<view bindtap="selectTime" data-index="{{index}}" wx:for="{{timelist}}" class="textOver date-time{{timeIndex==index?' active':''}}{{item.stock_number>0?'':' disable'}}">{{item.start_time}}-{{item.end_time}}<text wx:if="{{(item.stock_number>=10 || item.stock_number==-1)}}"> 有票</text><text wx:elif="{{item.stock_number<=0}}"> 无票</text><text wx:else>({{item.stock_number==-1?'无限':('余票'+item.stock_number)}})</text></view>
<view bindtap="selectTime" data-index="{{index}}" wx:for="{{timelist}}" class="textOver date-time{{timeIndex==index?' active':''}}{{item.stock_number>0?'':' disable'}}">{{item.start_time}}-{{item.end_time}}<text wx:if="{{(item.stock_number>=10)}}"> 有票</text><text wx:elif="{{item.stock_number==0}}"> 无票</text><text wx:elif="{{item.stock_number==-1}}">不开放</text><text wx:else>({{'余票'+item.stock_number}})</text></view>
</view>
<!-- <view class="date-times" wx:elif="{{activeDate.is_time_stock}}">
<view>已售罄</view>

9
pages/order/hotel/index.js

@ -28,13 +28,17 @@ Page({
priceInfo:[],
showMask:false,
editId:null,
linkmanList:[]
linkmanList:[],
prizeId:null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
prizeId:wx.getStorageSync('prizeId')
})
this.couponCom = this.selectAllComponents("#coupon")[0];
let CtripHotelCart = app.globalData.product;
// 获取默认联系人
@ -318,6 +322,9 @@ Page({
if(app.globalData.from){
data.system_name = app.globalData.from;
}
if(this.data.prizeId){
data.lottery_id = this.data.prizeId
}
if(app.globalData.retailId){
data.commission_code = app.globalData.retailId;
app.globalData.retailId = null;

2
pages/order/hotel/index.wxml

@ -72,7 +72,7 @@
<!-- 支付按钮 -->
<view style="height:{{100 }}rpx"></view>
<view class="fixed-bottom">
<view class="price-all">在线支付:<text>¥{{(CtripHotelCart.price_sum/100 * (numberIndex+1) - (coupon?coupon.activity.money/100:0))>0?CtripHotelCart.price_sum/100 * (numberIndex+1) - (coupon?coupon.activity.money/100:0):0}}</text></view>
<view class="price-all">在线支付:<text wx:if="{{prizeId}}">¥0</text><text wx:else>¥{{(CtripHotelCart.price_sum/100 * (numberIndex+1) - (coupon?coupon.activity.money/100:0))>0?CtripHotelCart.price_sum/100 * (numberIndex+1) - (coupon?coupon.activity.money/100:0):0}}</text></view>
<text class="price-tip" bindtap="showFee">每晚明细</text>
<view class="pay-btn" bindtap="gotoPay">去支付</view>
</view>

9
pages/order/movie/index.js

@ -13,7 +13,8 @@ Page({
tel:'',
product:null,
price:0,
coupon:null
coupon:null,
prizeId:null
},
/**
@ -25,6 +26,9 @@ Page({
util.back()
return;
}
this.setData({
prizeId:wx.getStorageSync('prizeId')
})
let product = app.globalData.product,price=0;
product.info.selectSeatInfo.map(item=>{
price = Number(item.price) + Number(price)
@ -92,6 +96,9 @@ Page({
if(app.globalData.from){
data.system_name = app.globalData.from;
}
if(this.data.prizeId){
data.lottery_id = this.data.prizeId
}
if(app.globalData.retailId){
data.commission_code = app.globalData.retailId;
app.globalData.retailId = null;

3
pages/order/movie/index.wxml

@ -18,7 +18,8 @@
<coupon money="{{price}}" sku="{{product.product.sku_info.id}}"></coupon>
<view class="fixed-bottom">
<view class="money-box">
<view class="price">¥{{((price - (coupon?coupon.activity.money:0))>0?(price - (coupon?coupon.activity.money:0)):0)/100}}</view>
<view class="price" wx:if="{{prizeId}}">¥0</view>
<view class="price" wx:else>¥{{((price - (coupon?coupon.activity.money:0))>0?(price - (coupon?coupon.activity.money:0)):0)/100}}</view>
<view wx:if="{{coupon}}">总计优惠{{coupon?coupon.activity.money/100:0}}元</view>
</view>
<!-- <view class="tip">明细</view> -->

9
pages/order/postOrder/index.js

@ -15,7 +15,8 @@ Page({
coupon:null,
sku_id:'',
kjId:null,
gp_id:null
gp_id:null,
prizeId:null
},
/**
@ -25,7 +26,8 @@ Page({
this.setData({
from:options.from,
kjId:app.globalData.kjId,
gp_id:app.globalData.gp_id || app.globalData.team_id
gp_id:app.globalData.gp_id || app.globalData.team_id,
prizeId:wx.getStorageSync('prizeId')
})
let price = 0,sku_id=[];
app.globalData.postProduct.map(item=>{
@ -140,6 +142,9 @@ Page({
data.commission_code = app.globalData.retailId;
app.globalData.retailId = null;
}
if(this.data.prizeId){
data.lottery_id = this.data.prizeId
}
if(app.globalData.category_id){
data.category_id = app.globalData.category_id;
}

3
pages/order/postOrder/index.wxml

@ -40,6 +40,7 @@
<coupon id="coupon" wx:if="{{!kjId && !gp_id}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon>
<view style="height:113rpx"></view>
<view class="fixed-bottom" wx:if="{{product}}">
<view class="fixed-price-box"><text>合计:</text><text class="price">¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}}</text></view>
<view class="fixed-price-box" wx:if="{{!prizeId}}"><text>合计:</text><text class="price">¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}}</text></view>
<view class="fixed-price-box" wx:else><text>合计:</text><text class="price">¥{{postFee?(0+postFee)/100:0}}</text></view>
<view class="fixed-btn" bindtap="order">提交订单</view>
</view>

9
pages/order/roadOrder/index.js

@ -21,13 +21,17 @@ Page({
editId:null,
price:0,
coupon:null,
sku_ids:""
sku_ids:"",
prizeId:null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
prizeId:wx.getStorageSync('prizeId')
})
userApi.user_post("user/getMyInfo").then(res=>{
this.setData({
reserve_mobile:res.data.mobile
@ -246,6 +250,9 @@ Page({
source:"WECHATXCX",
remark:this.data.remark
}
if(this.data.prizeId){
data.lottery_id = this.data.prizeId
}
if(app.globalData.from){
data.system_name = app.globalData.from;
}

3
pages/order/roadOrder/index.wxml

@ -39,7 +39,8 @@
</view> -->
<view style="height:113rpx"></view>
<view class="fixed-bottom">
<view class="order-all-price">订单金额:<text>¥{{((price - (coupon?coupon.activity.money:0))>0?(price - (coupon?coupon.activity.money:0)):0)/100}}</text></view>
<view class="order-all-price" wx:if="{{prizeId}}">订单金额:<text>¥0</text></view>
<view class="order-all-price" wx:else>订单金额:<text>¥{{((price - (coupon?coupon.activity.money:0))>0?(price - (coupon?coupon.activity.money:0)):0)/100}}</text></view>
<view class="order-btn" bindtap="order">去支付</view>
</view>
<view class="mask" style="align-items:flex-end" wx:if="{{linkmanFlag}}">

10
pages/order/scene/index.js

@ -20,7 +20,8 @@ Page({
isLogin:false,
kjId:null,
gp_id:null,
groupName:""
groupName:"",
prizeId:null
},
/**
@ -30,7 +31,8 @@ Page({
this.setData({
type:options.type,
kjId:app.globalData.kjId,
gp_id:app.globalData.gp_id || app.globalData.team_id
gp_id:app.globalData.gp_id || app.globalData.team_id,
prizeId:wx.getStorageSync('prizeId')
})
if(!app.globalData.product){
util.back();
@ -199,6 +201,9 @@ Page({
if(app.globalData.category_id){
data.category_id = app.globalData.category_id;
}
if(this.data.prizeId){
data.lottery_id = this.data.prizeId
}
let service = 'order/create',postData={
data:JSON.stringify(data)
}
@ -208,6 +213,7 @@ Page({
postData.team_name = this.data.groupName
postData.type = 1;
}
commonApi.user_post(service,postData).then(res=>{
if(app.globalData.kjId){
this.setData({

3
pages/order/scene/index.wxml

@ -31,7 +31,8 @@
<view style="{{type=='museum' || type=='activity'?'height:138rpx':'height:113rpx'}}"></view>
<view class="fixed-bottom" wx:if="{{type!='museum' && type!='activity'}}">
<view class="fixed-price-box" wx:if="{{kjId}}"><text>合计:</text><text class="price">¥0</text></view>
<view class="fixed-price-box" wx:if="{{kjId || prizeId}}"><text>合计:</text><text class="price">¥0</text></view>
<!-- <view class="fixed-price-box" wx:elif="{{prizeId}}"><text>合计:</text><text class="price">¥0</text></view> -->
<view class="fixed-price-box" wx:else><text>合计:</text><text class="price">¥{{((singlePrice * productNum - (coupon?coupon.activity.money:0))>0?(singlePrice * productNum - (coupon?coupon.activity.money:0)):0)/ 100}}</text></view>
<view class="fixed-btn" bindtap="order">提交订单</view>
</view>

9
pages/order/showOrder/index.js

@ -9,7 +9,8 @@ Page({
data: {
product:app.globalData.product,
contact:[],
coupon:null
coupon:null,
prizeId:null
},
/**
@ -17,7 +18,8 @@ Page({
*/
onLoad: function (options) {
this.setData({
product:app.globalData.product
product:app.globalData.product,
prizeId:wx.getStorageSync('prizeId')
})
},
setLinkman:function(e){
@ -54,6 +56,9 @@ Page({
"seats_ids":product.seats
}]
};
if(this.data.prizeId){
data.lottery_id = this.data.prizeId
}
if(app.globalData.from){
data.system_name = app.globalData.from;
}

3
pages/order/showOrder/index.wxml

@ -16,6 +16,7 @@
<coupon wx:if="{{product}}" money="{{product.timeInfo.price * product.seats.length}}" sku="{{product.sku[0].id}}"></coupon>
<view style="height:113rpx"></view>
<view class="fixed-bottom">
<view class="price-box">订单金额:<text>¥{{((product.timeInfo.price * product.seats.length - (coupon?coupon.activity.money:0))>0?(product.timeInfo.price * product.seats.length - (coupon?coupon.activity.money:0)):0) / 100}}</text></view>
<view class="price-box" wx:if="{{prizeId}}">订单金额:<text>¥0</text></view>
<view class="price-box" wx:else>订单金额:<text>¥{{((product.timeInfo.price * product.seats.length - (coupon?coupon.activity.money:0))>0?(product.timeInfo.price * product.seats.length - (coupon?coupon.activity.money:0)):0) / 100}}</text></view>
<view class="fixed-btn" bindtap="order">提交订单</view>
</view>

20
pages/pbService/appreciate/index.js

@ -1,5 +1,6 @@
// pages/pbService/appreciate/index.js
import commonApi from "../../../utils/https/common"
let app = getApp()
Page({
/**
@ -29,14 +30,6 @@ Page({
isIos:true
})
}
commonApi._post("pbservice/Other/getClientConfig",{
unique_key:"wechatxcx"
}).then(res=>{
let data = JSON.parse(res.data)
this.setData({
isTest:data.isTest
})
})
// 获取视频的标签
commonApi._post("pbservice/Artpopulate/videoTags").then(res=>{
res.data.unshift({
@ -143,7 +136,16 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady:function(){
if(app.globalData.configJson){
this.setData({
isTest:app.globalData.configJson.isTest
})
}
else {
setTimeout(()=>{
this.onReady()
},300)
}
},
/**

16
pages/user/user.wxml

@ -45,6 +45,12 @@
<navigator url="cartlist/list" class="user-box-line">
购物车
</navigator>
<navigator url="order/team/list" class="user-box-line">
团体订单
</navigator>
<!-- <navigator url="videoCoupon/index" class="user-box-line">
中奖纪录
</navigator> -->
<navigator url="service/index" class="user-box-line">
在线客服
</navigator>
@ -54,15 +60,19 @@
<navigator url="likes/index" class="user-box-line">
我的收藏
</navigator>
<!-- <navigator url="/pages/group/mine/index" class="user-box-line">
我的团购
</navigator>
<navigator url="/pages/kj/mine/index" class="user-box-line">
我的砍价
</navigator> -->
<!-- <view bindtap="retail" class="user-box-line">
我要分销
</view> -->
<navigator url="verify/index" class="user-box-line" wx:if="{{info && info.name_verification=='UNCERTFIED'}}">
实名认证
</navigator>
<navigator url="order/team/list" class="user-box-line">
团体订单
</navigator>
</view>
<view class="user-box" style="margin-bottom:0">
<navigator url="linkman/index" class="user-box-line">

96
pages/user/videoCoupon/index.js

@ -0,0 +1,96 @@
// pages/user/videoCoupon/index.js
import commonApi from "../../../utils/https/common"
import util from "../../../utils/util"
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
page:1,
total:1,
list:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getList()
},
getList(){
if(this.data.list.length>=this.data.total) return;
commonApi.user_post("actonline/video_act/prizeLog",{
id:5,
page:this.data.page,
limit:20
}).then(res=>{
this.setData({
total:res.data.total,
list:this.data.list.concat(res.data.data)
})
})
},
gotoDetail(e){
let item = e.currentTarget.dataset.item
if(item.type=='coupon'){
wx.navigateTo({
url: '/pages/user/coupon/index',
})
}
else if(item.type=='product'){
util.gotoDetail(item.prize_product)
wx.setStorageSync('prizeId', item.id)
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getList()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

5
pages/user/videoCoupon/index.json

@ -0,0 +1,5 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
}
}

11
pages/user/videoCoupon/index.wxml

@ -0,0 +1,11 @@
<!--pages/user/videoCoupon/index.wxml-->
<title title="中奖纪录"></title>
<view class="item" wx:for="{{list}}" bindtap="gotoDetail" data-item="{{item}}">
<image src="{{item.head_img}}"></image>
<view class="info">
<view class="title">{{item.prize_name}}</view>
<view>获取来源:{{item.act_name}}</view>
<view>获取时间:{{item.create_time}}</view>
</view>
</view>
<view wx:if="{{list.length==0}}" class="nomore">暂无数据</view>

39
pages/user/videoCoupon/index.wxss

@ -0,0 +1,39 @@
/* pages/user/videoCoupon/index.wxss */
page {
background: #EDEDED;
}
.item {
margin: 20rpx 30rpx;
background: white;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 13rpx;
}
.item image {
width: 250rpx;
height: 180rpx;
flex-shrink: 0;
display: block;
border-radius: 11rpx;
}
.info {
flex: 1;
margin-left: 20rpx;
font-size: 27rpx;
color: #999999;
line-height: 42rpx;
}
.info .title {
color: #000;
font-size: 30rpx;
font-weight: 500;
margin-bottom: 20rpx;
}
.nomore {
text-align: center;
margin-top: 40rpx;
font-size: 0.28rem;
color: #666;
}

2
project.config.json

@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
"urlCheck": true,
"urlCheck": false,
"es6": true,
"enhance": false,
"postcss": true,

4
project.private.config.json

@ -13,8 +13,8 @@
"miniprogram": {
"list": [
{
"name": "pages/group/index",
"pathName": "pages/group/index",
"name": "pages/pbService/web/index",
"pathName": "pages/pbService/web/index",
"query": "authCode=2c290d21383ccd3350747bba95f306f0",
"scene": null
},

13
utils/https.js

@ -192,7 +192,10 @@ function user_post_new(url,data={}){
return;
}
else if (res.data.code != 1 && res.data.msg) {
if(url.indexOf('actonline/act_online/vote')!=-1 && res.data.code==0){
if(url.indexOf('actonline/video_act/getRaffle')!=-1){
}
else if(url.indexOf('actonline/act_online/vote')!=-1 && res.data.code==0){
wx.showToast({
title: res.data.msg,
icon: "none",
@ -211,6 +214,7 @@ function user_post_new(url,data={}){
if(res.statusCode == 200){
if(url.indexOf('/order/create')!=-1 && res.data.code==1 && res.data.data){
// 下单成功
wx.removeStorageSync('prizeId')
if(res.data.data.pay_status==1){
// 0元直接付款成功
wx.navigateTo({
@ -227,6 +231,13 @@ function user_post_new(url,data={}){
})
}
}
else if(url.indexOf('/order/create')!=-1 && res.data.msg=='您有正在进行中或待支付的拼团,请查看拼团订单'){
setTimeout(() => {
wx.navigateTo({
url: '/pages/user/order/list',
})
}, 1000);
}
if(url.indexOf('product/get_product_detail')!=-1){
// 如果是产品详情的话 需要加埋点
_post('browse/ProductStatistics',{

2
utils/util.js

@ -151,7 +151,7 @@ const checkLocation = function(){
})
}
const gotoDetail = (item) =>{
console.log(item)
wx.removeStorageSync('prizeId');
switch(item.type){
case "tenscenic":
wx.navigateTo({

Loading…
Cancel
Save