Commit 97656a13 authored by 华国豪's avatar 华国豪 🙄
parents 5fd39006 79fa0afa
//app.js
let md5 = require('utils/md5.js')
let utilMd5 = require('utils/md5_2.js');
App({
// 小程序初始化时
onLaunch: function(options) {},
......@@ -42,8 +43,10 @@ App({
let sign = md5('cmd=' + url + '&' + 'msg=' + encodeURIComponent(data).toLowerCase() + '&' + 'timestamp=' + timestamp + '&' + 'token=' + getApp().state.admin.token + '&' + 'key=' + '')
wx.request({
// url: 'http://192.168.2.214:8082/api/Common/Post',
// url: 'http://192.168.2.65:8025/api/Common/Post',
url: 'https://reborn.oytour.com/api/common/post',
url: 'http://192.168.2.65:8025/api/Common/Post', //春姐
// url: 'https://reborn.oytour.com/api/common/post', //线上
// url: ' http://test.viitto.com/api/common/post',
method: 'POST',
data: {
cmd: url,
......@@ -72,5 +75,53 @@ App({
})
})
return promise;
},
// 抽奖接口2
$apit: function (url, msg, groupId, uid, token, secretKey) {
var promise = new Promise((resolve, reject) => {
wx.showLoading({
title: '加载中',
});
let timestamp = (new Date()).valueOf()
let sign = md5('msg=' + encodeURIComponent(JSON.stringify(msg)).toLowerCase() + '&' + 'timestamp=' + timestamp + '&' + 'token=' + token + '&' + 'key=' + secretKey)
wx.request({
// url: 'http://efficient.oytour.com/'+ url, //线上
url: 'http://192.168.2.215:9000/' + url, //测试 亚军
method: 'POST',
data: {
msg: msg,
timestamp: timestamp,
token: token,
sign: sign,
uid: uid,
groupId: groupId,
},
success(res) {
wx.hideLoading()
if (res.data.resultCode === 1) {
resolve(res.data.data);
} else if (res.data.resultCode === 10000 || res.data.resultCode === 10001) {
// wx.reLaunch({
// url: '/pages/login/login'
// })
} else {
wx.showToast({
title: res.data.message,
icon: 'none',
duration: 1000
})
reject(res.data)
}
}
})
})
return promise;
},
globalData: {
userInfo: null,
awardsConfig: {},
runDegs: 0
}
})
\ No newline at end of file
......@@ -10,7 +10,13 @@
"pages/login/login",
"pages/login/smsLogin/smsLogin",
"pages/login/revisePwd/revisePwd",
"pages/login/activate/activate"
"pages/login/activate/activate",
"pages/product/SametradeZW/SametradeZW",
"pages/product/SametradeZW/Applicationnotes/Applicationnotes",
"pages/product/SametradeZW/Successview/Successview",
"pages/product/SametradeZW/luckdraw/luckdraw",
"pages/product/SametradeZW/prizelist/prizelist"
],
"window": {
"backgroundTextStyle": "light",
......@@ -38,5 +44,6 @@
"text": "个人中心"
}
]
}
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
// pages/product/productDetail/productDetail.js
Page({
/**
* 页面的初始数据
*/
data: {
},
onLoad: function () {
wx.setNavigationBarTitle({
title: '同业预留占位确认'
})
}
})
\ No newline at end of file
<import src='../../../wxParse/wxParse.wxml' />
<view class="page">
<view class='box'>
<view class='xbox'>
<text class='title'>《报名需知》</text>
<text class='content'>1、确认报名后如取消出行或客人因自身原因无法出行,已付定金不予退还,我社保留追讨损失的权利。
2、门市收客前有义务告知客人,一旦开票后客人因各种要求退团即代表答应承担实际团款损失,我社不做另外解释说明
3、全程酒店(2人一标间)在不影响团队的情况下原则上夫妻可以安排一间,如果团队出现单男单女,领队有权拆开夫妻以保证团队需求或者加床处理。景点门票,行程所列餐,空调巴士,专业华语导游服务;往返国际航班经济舱机票及税金。
4、本公司已完全清楚以下四项团体机票规则:1)不可退票 2)不可改航班 3)不可改名 4)不可改期
5、敬请贵社检查客人的护照有效期6个月以上,在规定送签时间之前收齐资料。
6.如果游客因为自身原因签出签证后取消出团,需支付业务损失费如下:(1)使馆及旅行社收取签证费及签证所需的翻译、邮寄等手续费600元/人;(2)游客还应按国家旅游局的规定承担旅行社已产生的国际机票、境外住宿费、交通费等实际损失费。
7.购买单位承诺:如客人境外脱团、滞留不归,则赔偿我社违约金:10万元/人。本公司保留追究当事人及担保人的违约责任
8、旅游者须确保身体状况适宜参加本次旅游活动,并购买旅游意外保险。旅游者需对自己的身体健康负责。
9、旅游者应遵守卖方已明确告知、提示的相关信息,遵循旅游合同中双方协商一致的条款及约定。
10、行程中因各种原因,在保证整体行程内容及标准的情况下,卖方会适当调整行程内容的先后次序,旅游者理解并配合。
11、如因旅游者自行办理的证件、签注、签证导致旅游者无法正常出入境的,所产生的责任和费用由旅游者本人承担。
12、行程中如有购物活动安排或另行付费项目,旅游者可自愿选择是否购物或参加另行付费的项目。
13、由于旅游者自身原因导致合同不能按照约定履行,旅游者个人承担责任;给旅行社造成损失的,按合同约定执行。
14、行程中发生不可抗力因素(集会、罢工、战争、恐怖活动、政府行为、气象等)影响旅游行程,双方按合同约定执行。
15、旅游者不得在境外非法滞留,随团出行的旅游者不得擅自分团、脱团,不得参与未经旅行社同意的任何活动,如有此类现象发生,旅游者需个人承担法律及经济责任。
16、旅游者在活动时,不得进入赌场、夜总会、酒吧、色情等场所,不得参与一切含有潜在风险的各类活动.
17、旅游者应主动了解旅游目的地风俗习惯、宗教禁忌,不参与中国法律规定不宜参加的活动。
18、旅游者应文明旅游,注重礼仪,轻声细语,遵守时间,讲求秩序,爱护环境,保护文物,尊重服务人员。
19、旅游者应遵守各国海关规定,出入关时自觉申报,并根据相关规定,享受免税,依法纳税。
20、旅游者应遵守航空、铁路、船务、客车等公共交通承运人对乘客及行李的相关规定。并按上述有关部门的客货运规定执行,旅行社不对上述承运人的行为、规定、错误、损坏、赔付等承担责任。航班取消或延误属于航空公司的责任范畴。如需防范航班取消或延误会给游客带来不便,买方可提前通知游客购买航班延误取消保险。
21、旅行社、游客如有向对方提出赔付请求的,应按我国现行法律法规出示需要赔付的证据,该证据能充分证明要求赔付的合理性,并能获得法院及相关仲裁部门的认可。
22、如果游客因为自身原因签出签证后取消出团,需支付业务损失费如下:
(1)使馆及卖方收取签证费及签证所需的翻译、邮寄等手续费;
(2)游客还应按国家旅游局的规定承担卖方已产生的国际机票、境外住宿费、交通费等实际损失费。
23、旅游者、担保人需承诺境外脱团、滞留等违约行为发生后5日内应向卖方支付违约金。
24、如因人力不可抗拒或特殊原因导致行程变更、预定服务变更、取消游览(上岸游)、晚点、取消航班(次)等。双方同意按所购买的保险公司的保险方案执行。
25、法航、日本、泰国及东南亚部分国家的机票应航空公司要求必须提前买断,因此有些行程需要全款留位。
26、携带未成人出境旅游,携带者应为未成人的监护人并应签署监护人承诺书。如未签署承诺书,买方应承担责任。
27、70岁以上高龄老人需有人员陪伴出游,并签署高龄老人出游承诺书。如未签署承诺书,买方应承担责任。
28、如遇到酒店双人间房满,则自动升级为单人间
29、双方约定本确认书为旅游合同的附件具有同等法律效力</text>
</view>
</view>
</view>
\ No newline at end of file
.box{
width:100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
background: #F5F5F5;
}
.xbox{
width: 90%;
border-radius: 5px;
margin: 30rpx 0;
border:1;
border-color: #999;
background: white;
display: flex;
flex-direction: column;
align-items: center;
padding: 20rpx;
}
.title{
font-size: 14px;
color: #333333;
font-weight: 600;
line-height: 20px;
margin-bottom: 10rpx
}
.content{
font-size: 14px;
color: #333333;
font-weight: 300;
line-height: 22px
}
// pages/product/productDetail/productDetail.js
let app = getApp();
var WxParse = require('../../wxParse/wxParse.js');
var util = require('../../../utils/util.js')
Page({
/**
* 页面的初始数据
*/
data: {
proId:'',
tcid:null,
code:'',
createBy:'',
Price:0, //成交价格
TC_Price:0, // 根据是否是会员的价格
infolist:{},
peopleNum:0,
content:'',
selection:false,
admin:'',
phoneshow:true,
isMember:null, //是否是会员
telephone:false,//是否后台有这个电话号码
data: {},
Phonedata:{}, //根据电话号码返回的值
Detaildata:{}, //获取详情数据
openid:'',
},
Applicat:function(){
wx.navigateTo({
url: './Applicationnotes/Applicationnotes',
})
},
/**
* 人数减
*/
numLeft: function (e) {
let name = e.currentTarget.dataset.name
let num = this.data.peopleNum
if (num * 1 !== 0) {
this.setData({
peopleNum: num * 1 - 1
})
}
},
/**
* 人数加
*/
numRight: function (e) {
let name = e.currentTarget.dataset.name
let num = this.data.peopleNum
this.setData({
peopleNum: num * 1 + 1
})
},
//预计提成
bindKeyInput:function(e){
this.setData({
peopleNum: e.detail.value
})
},
selectionimg:function(){
let selection = this.data.selection
if (selection==false){
this.setData({
selection:true
})
}
if (selection == true) {
this.setData({
selection: false
})
}
},
phone:function(e){
if (e.detail.value.length == 11){
app.$api('miniProgram_customer_GetCustomerByPhone', { code: this.data.code, Contact: e.detail.value, openid: this.data.openid}).then(res => {
this.setData({ telephone: true, isMember: res.isMember, Phonedata: res})
}).catch(err => {
this.setData({ telephone: false })
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
} else if (e.detail.value.length != 11){
this.setData({ telephone: false,})
}
this.setData({
content: e.detail.value,
})
},
qr:function(){
if (this.data.isMember != null && this.data.isMember == 1) {
this.setData({
TC_Price: this.data.Detaildata.B2BMemberPrice
})
} else {
this.setData({
TC_Price: this.data.Detaildata.B2BPrice
})
}
if (this.data.peopleNum >0){
app.$api('sellorder_get_GetOrderMinPrice', { ltID: this.data.Detaildata.ltID, Num: this.data.peopleNum }).then(res => {
let SPrice = res;
let yjtc = this.data.peopleNum * this.data.Price + (this.data.Detaildata.OtherPrice + this.data.Detaildata.VisaPrice) * this.data.peopleNum;
// let PriceSpread = this.data.Price - (this.data.TC_Price - SPrice);
// let ExtraCommission = PriceSpread > 0 ? PriceSpread.toFixed(2) * 0.5 : PriceSpread;
// let Commission = (Number(yjtc * 0.01) + Number(ExtraCommission)).toFixed(2);
let msg = {
OrderId: 0,
TCID: this.data.tcid,
CustomerType: this.data.isMember,
GroupType: 1,
ContactName: this.data.Phonedata.Contact,
ContactMobile: this.data.Phonedata.ContactNumber,
CustomerId: this.data.Phonedata.id,
DepartureCityId: this.data.Detaildata.StartCityID, //出发城市
IsIntermodal: 0, //是否联运 1是 2否
Unit_Price: this.data.Price, //成交单价 分享出来的
TC_Price: this.data.TC_Price, //根据会员给的价格
ManNum: this.data.peopleNum,
ChirdNum: 0,
ChirdNeedBedNum: 0,
BabyNum: 0,
OldPeopleNum: 0,
SingleRoomNum: 0,
PreferPrice: yjtc,
DiscountMoney: 0,
CouponAllotIds: '',
YSeatNum: this.data.peopleNum,//人数
ESeatNum: 0,
FSeatNum: 0,
Commission: 0, //预计提成
ClientSource: 2,
BrandId: 0,
TradeWay: 0, //交易方式
PlatformOrder: '', //平台单号
GuestNum: this.data.peopleNum, //客人总数 人数
IsChildrenTour: this.data.Detaildata.IsSupportChildren, //是否支持儿童游玩 1是 2否
IsBirdDiscount: 2, //是否享用早鸟优惠 1是 2否 ????
PredictRoomNum: this.data.peopleNum / 2,
BigRoomNum: 0, //大床房
TripleRoomNum: 0, //三人房
TradeDate: util.formatTime(new Date()), //交易日期 当前日期日期
CostType: 0, //费用类型
MinOrderPrice: 0,
Remarks: '',
VisaNum: this.data.peopleNum, //人数
SafeNum: this.data.peopleNum,
AirticketNum: 0,
ReturnArriveCityId: this.data.Detaildata.ReturnArriveCityId, //返回抵达城市
IsReturnIntermodal: 0,
GoCityTime: "",
BackCityTime: '',
ScenicRefundArr: [],
CommissionSharePeople: 0,
CommissionShareMoney: 0,
OrderSource: 2,
OrderForm: 4,
CustomerCreateBy: this.data.createBy,
}
//提交数据
let that = this;
let data = that.data.Phonedata.contactNumber;
app.$api('sellorder_post_SetOrderInfoForB2B', msg).then(res => {
wx.reLaunch({ //保留当前页面,跳转到应用内的某个页面(最多打开5个页面,之后按钮就没有响应的)
url: "./Successview/Successview?contactNumber="+data
})
}).catch(err => {
})
}).catch(err => {
})
}else{
wx.showToast({
title: '报名人数大于0',
icon: 'none',
duration: 1000
})
return
}
},
getDetail: function (id){
app.$api('miniProgram_price_GetTravelEntity', { TCID: id }).then(res => {
this.setData({
Detaildata: res,
})
}).catch(err => {
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options){
wx.login({
success: res => {
this.setData({ code : res.code})
if (res.code) {
app.$api('miniProgram_customer_LoginByMinOpenId', { code: res.code }).then(res => {
this.setData({ data: res, phoneshow: false, isMember: res.isMember, openid: res.openid, telephone: true, Phonedata:res})
}).catch(err => {
this.setData({ data: err.data, phoneshow: true, isMember: err.data.isMember, openid: err.data.openid})
})
} else {
wx.showToast({
title: '获取用户信息失败',
icon: 'none',
duration: 1000
})
}
}
})
//解析分享带过来的参数options
let scene = JSON.stringify(options);
let obj = JSON.parse(scene)
if (obj !== 'undefined') {
let createBy = obj.createBy
let tcId = obj.tcId
let configId = obj.configId
let price = obj.price
//测试数据
// let createBy = '1790'
// let tcId = '3649'
// let configId = '2470'
// let price = '10000'
this.setData({
createBy: createBy,
tcid: tcId,
proId: configId,
Price: price
})
this.getDetail(tcId)
} else {
this.setData({
isMember: app.state.admin.isMember,
proId: options.id,
tcid: options.tcid ? parseInt(options.tcid) : null
})
let tcid = options.tcid ? parseInt(options.tcid) : null;
this.getDetail(tcid)
}
wx.setNavigationBarTitle({
title: '同业预留占位确认'
})
}
})
{}
\ No newline at end of file
<import src='../../wxParse/wxParse.wxml' />
<view class="page">
<view class='box'>
<image class='logo' src='../../../images/product/logo_t.png'></image>
<view class='xbox'>
<view class='title_box'>
<text class='title'>{{Detaildata.Title}}</text>
<view class='t_time'>
<text class='t_time_t'>出团日期:</text>
<text class='t_time_t'>{{Detaildata.QStartDate}}</text>
</view>
</view>
<image class='division' src='../../../images/product/yangs.png'></image>
<view class='zw_information'>
<view class='zw_Price'>
<text class='zw_Price_l'>结算价格</text>
<view class='zw_Price_r'>
<text class='qian'>{{Price}}</text>
<text class='yuan'>元/人</text>
</view>
</view>
<view class='xian'></view>
<view class='zw_Price'>
<text class='zw_Price_l'>占位定金</text>
<view class='zw_dj_r'>
<view class='zw_r_t'>
<text class='qian'>{{Detaildata.BackAddPrice}}</text>
<text class='yuan'>元/人</text>
</view>
<text class='yuan'>(系统将为本单预留72小时)</text>
</view>
</view>
</view>
<view class='Title_t'>
<view class='title_xian'></view>
<view class='title_content'>
<text class='title_text'>填写信息</text>
</view>
</view>
<view class='inform'>
<text class='inform_l'>报名人数</text>
<view class='form_item_right'>
<text class="form_item_right_btn" data-name='peopleNum' style='{{peopleNum===0?"color: #CCCCCC;":""}}' bindtap='numLeft'>-</text>
<input class="form_item_right_in" data-name='peopleNum' value='{{peopleNum}}' type="number" bindinput="bindKeyInput"/>
<text class="form_item_right_btn" data-name='peopleNum' bindtap='numRight'>+</text>
</view>
</view>
<view class='{{phoneshow == true ? "inform" : "inform_none"}}'>
<text class='inform_l'>同行手机</text>
<view class='form_item_inBox'>
<input class='form_item_input' type='number' value="{{content}}" placeholder-class="form_item_holder" placeholder="请输入手机号" bindinput="phone"></input>
</view>
</view>
<view class='notice'>
<image class='notice_image' bindtap='selectionimg'
src="{{selection == false ?'../../../images/product/kuang.png':'../../../images/product/kuang_x.png' }}"></image>
<text class='notice_t'>已查看</text>
<view class='applicat' bindtap='Applicat' >
<text class='notice_t_r'>《报名须知》</text>
</view>
</view>
<view class='confirm' style='{{selection == true && telephone ==true? "background: #FF9800":"background: #D6D6D6"}}'
bindtap='{{selection == true && telephone ==true? "qr" :""}}'
>
<text class='queren' >确认预留</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* pages/product/productDetail/productDetail.wxss */
/* 头部封面轮播 */
.box{
width:100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
background: #F5F5F5;
}
.logo{
width: 422rpx;
height: 60rpx;
margin:25rpx 0;
}
.xbox{
width: 90%;
border-radius: 5px;
margin-top: 10rpx;
border:1;
border-color: #999;
background: white;
display: flex;
flex-direction: column;
align-items: center
}
.title_box{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
text-align: center
}
.title{
width: 90%;
font-size: 18px;
color: #333333;
margin-top: 40rpx;
}
.t_time{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin-top: 10rpx
}
.t_time_image{
width: 30rpx;
height: 30rpx;
}
.t_time_t{
font-size: 15px;
color: #999999;
margin-left: 16rpx;
}
.division{
width: 100%;
height: 60rpx;
margin:30rpx 0;
background: #F5F5F5
}
.zw_information{
width: 90%;
height: 240rpx;
background: #F8F8F8;
border-radius: 4px;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10rpx
}
.zw_Price{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 90%;
height: 119rpx;
}
.zw_Price_l{
font-size: 14px;
color: #666666;
}
.zw_Price_r{
display: flex;
flex-direction: row;
align-items: flex-end;
}
.qian{
font-size: 16px;
color: #333333;
}
.yuan{
font-size: 12px;
color: #999999;
}
.xian{
width:100%;
height: 2rpx;
background: white;
}
.zw_dj_r{
display: flex;
flex-direction: column;
align-items: flex-end;
justify-content: center;
}
.zw_r_t{
display: flex;
flex-direction: row;
align-items: flex-end;
}
.Title_t{
width: 90%;
height: 40rpx;
display: flex;
flex-direction: row;
align-items: center;
position: relative;
margin-top: 66rpx;
margin-bottom: 50rpx;
}
.title_xian{
width: 100%;
height: 2rpx;
background: #F3F3F3;
}
.title_content{
width: 160rpx;
height: 40rpx;
position: absolute;
left: 50%;
top: 0;
margin-left: -80rpx;
background: white;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.title_text{
font-size: 14px;
color: #333333;
}
.inform{
width: 90%;
height: 50px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-bottom: 40rpx
}
.inform_none{
display: none
}
.inform_l{
font-size: 14px;
color: #333333;
}
.form_item_right{
display: flex;
width: 90px;
height: 30px;
}
.form_item_right_btn{
width: 30px;
height: 30px;
line-height: 28px;
text-align: center;
font-weight: bold;
font-size: 18px;
color: #257BF1;
border: 1px solid #E0E0E0;
}
.form_item_right_in{
width: 30px;
height: 30px;
text-align: center;
font-size: 16px;
color: #333333;
border-top: 1px solid #E0E0E0;
border-bottom: 1px solid #E0E0E0;
}
.form_item_inBox{
margin: 0 0 0 10px;
flex-grow: 1;
display: flex;
align-items: center;
height: 30px;
}
.form_item_input{
flex-grow: 1;
font-size: 14px;
color: #333333;
text-align: right
}
.form_item_holder{
font-size: 14px;
color: #999999;
text-align: right
}
.notice{
width: 90%;
height:40rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.notice .applicat{
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.notice_t{
font-size: 12px;
color: #333333;
}
.notice_t_r{
font-size: 12px;
color: #257BF1;
}
.confirm{
width: 90%;
height: 90rpx;
border-radius: 45rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin:30rpx 0;
}
.queren{
font-size: 16px;
color: #FFFFFF;
font-weight: 200
}
.notice_image{
width: 26rpx;
height: 26rpx;
margin-right: 20rpx;
}
\ No newline at end of file
// pages/product/productDetail/productDetail.js
var util = require('../../../../utils/util.js')
let app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
year:'',
month: '',
day: '',
hour: '',
minute: '',
token:'',
contactNumber:'',
},
onLoad: function (option){
let contactNumber= option.contactNumber
this.setData({ contactNumber: contactNumber})
let Millisecond = new Date().getTime();
let zong = Millisecond + 72 * 60 * 60 * 1000;
let time = new Date(zong);
this.setData({
year: time.getFullYear(),
month: time.getMonth() + 1,
day: time.getDate(),
hour: time.getHours(),
minute: time.getMinutes()
})
wx.setNavigationBarTitle({
title: '同业预留占位确认'
})
},
draw:function(){
// this.data.contactNumber
app.$api('b2b_post_MiniProgramGetAccountInfoByPhone', { account: this.data.contactNumber, }).then(res => {
var token = res.token;
var secretKey = res.secretKey;
var uid = res.customerId;
var groupId = res.groupId;
// wx.reLaunch({
wx.navigateTo({
url: '../luckdraw/luckdraw?token=' + token + '&secretKey=' + secretKey + '&uid=' + uid + '&groupId=' + groupId,
})
}).catch(err => {
})
},
draw_t:function(){
wx.showToast({
title: '活动还在筹备中,敬请期待!',
icon: 'none',
duration: 2000
})
}
})
\ No newline at end of file
<import src='../../../wxParse/wxParse.wxml' />
<view class="page">
<view class='box'>
<image class='success' src='../../../../images/product/success.png'></image>
<view class='xbox'>
<text class='title'>提交成功</text>
<text class='title_t'>系统将为本单预留72小时</text>
<view class='content'>
<view class='content_t'>
<view class='img_ti'>
<text>!</text>
</view>
<text class='content_ts'>特别提示</text>
</view>
<view class='content_c'>
<text class='c_hou'><text class='c_qian'>{{year}}年{{month}}月{{day}}日{{hour}}:{{minute}}时</text>内未确认支付定金,系统将自动删除本订单,不再另行通知,敬请知悉!如在72小时内,团满需要清位,将由本公司销售人员另行通知! </text>
</view>
</view>
<text class='tips'>
请于上述时间支付本单定金或上本公司签约供应商系统平台,以供应商平台正式报名确认为准。
</text>
<!-- <navigator url='SametradeZW/luckdraw/luckdraw'>
<text>抽奖</text>
</navigator> -->
</view>
</view>
<!-- 广告位 -->
<view class='huo'>
<view class='advertisement' bindtap='draw' catchtouchmove="doNothing">
<image src='../../../../images/product/huodong.png'></image>
</view>
<view class='advertisement' bindtap='draw_t' catchtouchmove="doNothing">
<image src='../../../../images/product/guanggao.jpg'></image>
</view>
</view>
<view style="width: 100%;height : 50px"></view>
</view>
\ No newline at end of file
.box{
width:100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
background: #F5F5F5;
position: relative
}
.xbox{
width: 90%;
border-radius: 4px;
margin-top: 100rpx;
border:1;
border-color: #999;
background: white;
display: flex;
flex-direction: column;
align-items: center;
padding: 10rpx;
box-shadow:1px 1px 3px 3px #d2d2d2;
margin-bottom: 5px
}
.success{
width: 140rpx;
height: 140rpx;
position: absolute;
top: 30rpx;
left: 50%;
margin-left: -70rpx
}
.title{
font-size: 16px;
color: #000000;
font-weight: 600;
margin-top: 80rpx;
}
.title_t{
font-size: 14px;
color: #555555;
margin-top: 10rpx;
font-weight: 500
}
.content{
width: 90%;
/* height: 280rpx; */
display: flex;
flex-direction: column;
align-items: center;
background: #F8F8F8;
border-radius: 5px;
margin-top: 50rpx;
}
.content_t{
display: flex;
flex-direction: row;
align-items: center;
margin-top: 35rpx;
}
.img_ti{
width: 30rpx;
height: 30rpx;
border-radius: 15rpx;
background: #257BF1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.img_ti text{
font-size: 10px;
color: white;
}
.content_ts{
font-size: 14px;
color: #257BF1;
margin-left: 16rpx;
}
.content_c{
width: 90%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
margin: 25rpx 0;
}
.c_qian{
font-size: 14px;
color: #257BF1;
line-height: 25px;
}
.c_hou{
font-size: 14px;
color: #333333;
line-height: 20px;
}
.tips{
width: 90%;
font-size: 12px;
color: #666666;
margin:15rpx 0
}
.huo{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.advertisement{
width: 90%;
height: 200rpx;
box-shadow:1px 1px 3px 3px #d2d2d2;
margin: 5px 0;
border-radius: 5px;
margin-top: 50rpx
}
.advertisement image{
width: 100%;
height: 100%;
border-radius: 5px
}
\ No newline at end of file
var app = getApp()
Page({
data: {
awardsList: {},
animationData: {},
btnDisabled: '',
remainingCount:0,
btnname: "getLottery",
token:'',
Lotterylist:[],
high:true,
token:'',
secretKey:'',
uid:0,
groupId:0,
lotteryId:0,
lotteryRules:'',
},
getLottery: function () {
let token = this.data.token;
let secretKey = this.data.secretKey;
let uid = this.data.uid;
let groupId = this.data.groupId;
let lotteryId = this.data.lotteryId;
app.$apit('api/sell/lottery/getLotteryAward', { lotteryId: lotteryId,}, groupId, uid, token, secretKey).then(res => {
console.log(res)
var that = this;
if (that.data.remainingCount >0 ){
that.setData({ btnname:''})
var len = app.awardsConfig.awards.length;
// var awardIndex = Math.random() * len >>> 0;
var awardIndex = 1;
let Lotterylist = that.data.Lotterylist;
for (var i = 0; i < Lotterylist.length; i++){
if (res.awardName == Lotterylist[i].awardName){
awardIndex = i;
}
}
// 获取奖品配置
var awardsConfig = app.awardsConfig,
runNum = 8
console.log(awardIndex)
// 旋转抽奖
app.runDegs = app.runDegs || 0
console.log('deg', app.runDegs)
app.runDegs = app.runDegs + (360 - app.runDegs % 360) + (360 * runNum - awardIndex * (360 / len ))
console.log('deg', app.runDegs)
var animationRun = wx.createAnimation({
duration: 4000,
timingFunction: 'ease'
})
that.animationRun = animationRun
animationRun.rotate(app.runDegs).step()
that.setData({
animationData: animationRun.export(),
// btnDisabled: 'disabled'
})
//减一次次数
this.setData({ remainingCount: that.data.remainingCount-1})
// 记录奖品
var winAwards = wx.getStorageSync('winAwards') || { data: [] }
winAwards.data.push(awardsConfig.awards[awardIndex].awardName + '1个')
wx.setStorageSync('winAwards', winAwards)
// 中奖提示
setTimeout(function () {
wx.showModal({
title: '恭喜',
content: '获得' + (awardsConfig.awards[awardIndex].awardName),
showCancel: false,
success(res){
if (res.confirm){
that.setData({ btnname: 'getLottery' })
}
}
})
if (awardsConfig.chance) {
that.setData({
btnDisabled: ''
})
}
}, 4000);
}else{
wx.showToast({
title: '抽奖次数已用完',
icon: 'none',
duration: 1000
})
}
}).catch(err => {
})
},
gotoList:function(){
let token = this.data.token;
let secretKey = this.data.secretKey;
let uid = this.data.uid;
let groupId = this.data.groupId;
let lotteryId = this.data.lotteryId;
wx.navigateTo({
url: '../prizelist/prizelist?token=' + token + '&secretKey=' + secretKey + '&uid=' + uid + '&groupId=' + groupId + '&lotteryId=' + lotteryId,
})
},
onLoad: function (option) {
//获取屏幕高度来设置位移多少
let heightH = wx.getSystemInfoSync().windowHeight;
console.log(heightH)
if (heightH> 700){
this.setData({
high:false,
})
}
let token = option.token;
let secretKey = option.secretKey;
let uid = option.uid;
let groupId = option.groupId
let lotteryId = 0;
let that = this;
that.setData({
token: token,
secretKey: secretKey,
uid: uid,
groupId: groupId,
})
var list = [];
// //获取抽奖列表
app.$apit('api/sell/lottery/getB2bTaskLottery', {}, groupId, uid, token, secretKey).then(res => {
console.log(res.lotteryAwardItem)
let a = res.lotteryRules ;
let b = a.replace(/<p>/g, '\n');
let c = b.replace(/[</p>]/g, '')
console.log(c)
this.setData({
lotteryId: res.id,
Lotterylist: res.lotteryAwardItem,
lotteryRules: c,
})
// //获取抽奖次数
app.$apit('api/sell/lottery/getLotteryRemainingCount', { lotteryId: res.id }, groupId, uid, token, secretKey).then(res => {
this.setData({
remainingCount: res.remainingCount,
})
}).catch(err => {
})
list = res.lotteryAwardItem
app.awardsConfig = {
chance: true,
awards: list,
}
// wx.setStorageSync('awardsConfig', JSON.stringify(awardsConfig))
// 绘制转盘
var awardsConfig = app.awardsConfig.awards,
len = awardsConfig.length,
rotateDeg = 360 / len / 2 + 90,
html = [],
turnNum = 1 / len // 文字旋转 turn 值
that.setData({
btnDisabled: app.awardsConfig.chance ? '' : 'disabled'
})
var ctx = wx.createContext();
for (var i = 0; i < len; i++) {
// 保存当前状态
ctx.save();
// 开始一条新路径
ctx.beginPath();
// 位移到圆心,下面需要围绕圆心旋转
ctx.translate(150, 150);
// 从(0, 0)坐标开始定义一条新的子路径
ctx.moveTo(0, 0);
// 旋转弧度,需将角度转换为弧度,使用 degrees * Math.PI/180 公式进行计算。
ctx.rotate((360 / len * i - rotateDeg) * Math.PI / 180);
// 绘制圆弧
ctx.arc(0, 0, 150, 0, 2 * Math.PI / len, false);
// 颜色间隔
if (i % 2 == 0) {
ctx.setFillStyle('rgba(255,184,32,.1)');
} else {
ctx.setFillStyle('rgba(255,203,63,.1)');
}
// 填充扇形
ctx.fill();
// 绘制边框
ctx.setLineWidth(0.5);
ctx.setStrokeStyle('rgba(228,55,14,.1)');
ctx.stroke();
// 恢复前一个状态
ctx.restore();
// 奖项列表
html.push({ turn: i * turnNum + 'turn', lineTurn: i * turnNum + turnNum / 2 + 'turn', award: awardsConfig[i].awardName });
}
that.setData({
awardsList: html
});
}).catch(err => {
})
}
})
{
"navigationBarTitleText": "抽奖"
}
\ No newline at end of file
<view class="wrapper">
<image class='title' src='../../../../images/product/title_n.png'></image>
<view class="main">
<scroll-view class="canvas-container" catchtouchmove="doNothing">
<view animation="{{animationData}}" class="canvas-content" >
<canvas style="width: 300px; height: 300px;" class="canvas-element" canvas-id="lotteryCanvas"></canvas>
<view class="canvas-line">
<view class="canvas-litem" wx:for="{{awardsList}}" wx:key="unique" style="-webkit-transform: rotate({{item.lineTurn}});transform: rotate({{item.lineTurn}})"></view>
</view>
<view class="canvas-list">
<view class="canvas-item" wx:for="{{awardsList}}" wx:key="unique">
<view class="canvas-item-text" style="-webkit-transform: rotate({{item.turn}});transform: rotate({{item.turn}})">{{item.award}}</view>
</view>
</view>
</view>
<!-- <view bindtap="getLottery" class="canvas-btn {{btnDisabled}}">抽奖</view> -->
<image src='../../../../images/product/jt2.png' bindtap="{{btnname}}" class="canvas-btn {{btnDisabled}}" disabled="{{disabled}}"></image>
</scroll-view>
<view class='button_b'>
<view class='button_b_l'>
<text>{{remainingCount}}</text>
</view>
<view class='button_b_r' bindtap="gotoList">
</view>
</view>
</view>
</view>
<view class='explain' style="{{high == true ? 'margin-top: 125rpx;' :'margin-top: 300rpx'}}">
<text>活动说明</text>
<text id='mjltest'>{{lotteryRules}}</text>
</view>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
// pages/product/productDetail/productDetail.js
var util = require('../../../../utils/util.js')
var app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
pageData:[],
},
onLoad: function (option) {
let token = option.token;
let secretKey = option.secretKey;
let uid = option.uid;
let groupId = option.groupId;
let lotteryId = option.lotteryId;
app.$apit('/api/b2b/lottery/getUserLotteryWinningList', { lotteryId: lotteryId, pageIndex: 1, pageSize: 20 }, groupId, uid, token, secretKey).then(res => {
this.setData({
pageData: res.pageData
})
}).catch(err => {
})
}
})
\ No newline at end of file
{
"navigationBarTitleText": "我的奖品"
}
\ No newline at end of file
<import src='../../../wxParse/wxParse.wxml' />
<view class="page">
<scroll-view class='container' scroll-y="true">
<view class='contnet' wx:for="{{pageData}}" wx:key="index">
<text class='awname'>{{item.awardName}}</text>
<text class='winDate'>{{item.winningDate}}</text>
</view>
</scroll-view>
</view>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment