Commit 6ef23112 authored by qipeng's avatar qipeng

Merge branch 'develop' of http://git.tbd.yanzuoguang.com/panyongping/uni-pdtravel into develop

parents bc51fcdf b26c4236
<script> <script>
// 1、uni-app的页面生命周期仅在page页面有效,而单独封装的组件中【页面周期无效】, // 1、uni-app的页面生命周期仅在page页面有效,而单独封装的组件中【页面周期无效】,
//但是Vue的生命周期依然有效 【Vue的生命周期在任何地方都是有效的,即你仍然可以在uni-app项目中使用Vue生命周期,但是不建议这么做】 //但是Vue的生命周期依然有效 【Vue的生命周期在任何地方都是有效的,即你仍然可以在uni-app项目中使用Vue生命周期,但是不建议这么做】
// 2、推荐使用uni-app里面的onLoad 代替 vue 里面的 created // 2、推荐使用uni-app里面的onLoad 代替 vue 里面的 created
// 3、推荐使用uni-app里面的onReady 代替 vue 里面的 mounted // 3、推荐使用uni-app里面的onReady 代替 vue 里面的 mounted
//4.setStorageSync与setStorage的区别:如果后续的操作需要使用更新storage后保存的data,则使用setStorageSync使用异步性能更好,使用同步数据更安全 //4.setStorageSync与setStorage的区别:如果后续的操作需要使用更新storage后保存的data,则使用setStorageSync使用异步性能更好,使用同步数据更安全
export default { export default {
onLaunch: function(options) {//初始化完成时触发(全局只触发一次 onLaunch: function(options) { //初始化完成时触发(全局只触发一次
let today=this.$commonjs.today() let today = this.$commonjs.today()
let oldDate=uni.getStorageSync('oldDate') let oldDate = uni.getStorageSync('oldDate')
//大于7天重新登录 //大于7天重新登录
if(oldDate){ if (oldDate) {
let number=this.$commonjs.dateDifference(today,oldDate) let number = this.$commonjs.dateDifference(today, oldDate)
if(number>7){ if (number > 7) {
uni.clearStorageSync()
}
} else {
//用于处理这个功能之前登录过的用户,未保存登录时间
uni.clearStorageSync() uni.clearStorageSync()
} }
}else{ let path = options.path
//用于处理这个功能之前登录过的用户,未保存登录时间 uni.setStorageSync('enterOptions', options)
uni.clearStorageSync() let token = uni.getStorageSync('token')
if (!token && path.indexOf('pages/payment/ourPayment/ourPayment') == -1) { //扫码支付页面不需要在此登录
setTimeout(() => { //解决关联普通二维码扫码首次进入时一直显示登录中
uni.navigateTo({
url: '/pages/login/login'
})
}, 300)
}
//#ifdef MP-WEIXIN
uni.setStorageSync('appid', 'wxe678d5240e98a7b8')
//#endif
//#ifdef MP-ALIPAY
if (options.query && options.query.qrCode) {
uni.setStorageSync('alipayQrCode', options.query.qrCode)
} else {
uni.removeStorageSync('alipayQrCode')
}
//#endif
},
onShow: function() {
},
onHide: function() {
} }
let path=options.path }
uni.setStorageSync('enterOptions',options)
let token=uni.getStorageSync('token')
if(!token&&path.indexOf('pages/payment/ourPayment/ourPayment')==-1){//扫码支付页面不需要在此登录
setTimeout(()=>{//解决关联普通二维码扫码首次进入时一直显示登录中
uni.navigateTo({
url: '/pages/login/login'
})
},300)
}
//#ifdef MP-WEIXIN
uni.setStorageSync('appid','wxe678d5240e98a7b8')
//#endif
//#ifdef MP-ALIPAY
if (options.query && options.query.qrCode) {
uni.setStorageSync('alipayQrCode',options.query.qrCode)
}else{
uni.removeStorageSync('alipayQrCode')
}
//#endif
},
onShow: function() {
},
onHide: function() {
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";
/*
/*
1.页面背景颜色#f7f7f7 1.页面背景颜色#f7f7f7
2.分隔线颜色#DBDBDB 2.分隔线颜色#DBDBDB
3.正常字体颜色#333333 3.正常字体颜色#333333
...@@ -61,21 +62,51 @@ export default { ...@@ -61,21 +62,51 @@ export default {
8.页面最外层与里面的第一层为padding:0 12px; 8.页面最外层与里面的第一层为padding:0 12px;
9.css单位为rpx 9.css单位为rpx
*/ */
page{font-size:28rpx;color: #333333;background: #F7F7F7;height: 100%;} page {
view,text,image,video,button,checkbox,form,input,label,radio,switch,textarea{box-sizing:border-box;} font-size: 28rpx;
.btn{background:linear-gradient(132deg, #ED400C 0%, #FB862C 100%);display: inline-block;color: #FFFFFF;font-size:28rpx;border-radius:8rpx;text-align: center;} color: #333333;
/*单行溢出*/ background: #F7F7F7;
.one-txt-cut{ height: 100%;
overflow: hidden; }
white-space: nowrap;
text-overflow: ellipsis; view,
} text,
/*多行溢出 手机端使用*/ image,
.txt-cut{ video,
overflow : hidden; button,
text-overflow: ellipsis; checkbox,
display: -webkit-box; form,
/* -webkit-line-clamp: 2; */ input,
-webkit-box-orient: vertical; label,
} radio,
switch,
textarea {
box-sizing: border-box;
}
.btn {
background: linear-gradient(132deg, #ED400C 0%, #FB862C 100%);
display: inline-block;
color: #FFFFFF;
font-size: 28rpx;
border-radius: 8rpx;
text-align: center;
padding: 10rpx 20rpx;
}
/*单行溢出*/
.one-txt-cut {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/*多行溢出 手机端使用*/
.txt-cut {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
/* -webkit-line-clamp: 2; */
-webkit-box-orient: vertical;
}
</style> </style>
...@@ -279,6 +279,13 @@ ...@@ -279,6 +279,13 @@
"navigationBarTitleText" : "兑换", "navigationBarTitleText" : "兑换",
"enablePullDownRefresh" : false "enablePullDownRefresh" : false
} }
},
{
"path" : "pages/common/simpleProduct/simpleProduct",
"style" : {
"navigationBarTitleText" : "产品选择",
"enablePullDownRefresh" : false
}
} }
], ],
"globalStyle" : { "globalStyle" : {
......
<template>
<view>
<view v-for="(item,index) in productData" :key="inde" class="list">
<view class="list-left">
<view>{{item.name}}</view>
<view class="money">
<text style="font-size: 28rpx;">¥</text>{{parseFloat((item.sellingPrice).toFixed(2))}}
</view>
</view>
<view class="list-right">
<text class="btn">购买</text>
</view>
</view>
<view class="no-more">没有更多了...</view>
</view>
</template>
<script>
export default {
data() {
return {
productData:[],//产品数据
merchantId:'',//商户Id
}
},
onLoad(option) {
this.merchantId=option.merchantId||''
this.initProduct()
},
methods: {
//---产品加载
initProduct(){
let data={
merchantId:this.merchantId,//商户id
type:1,//类型:1景区、2酒店、3餐饮
}
this.$request('scenic/user/product/findProductList',data).then((res)=>{
if(res.code=="00"){
this.productData=res.data.list||[]
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
}
}
</script>
<style scoped lang="scss">
.list{
display: flex;
align-items: center;
padding: 30rpx 20rpx;
border-bottom: 1px solid #E6e6e6;
}
.list-left{
flex: 1;
margin-right: 30rpx;
}
.money{
margin-top: 10rpx;
font-size: 40rpx;
color: #f9690e;
font-weight: bolder;
}
.no-more{
text-align: center;
margin:30rpx 0;
}
</style>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
export default { export default {
data() { data() {
return { return {
title: "正在出票中", //标题 title: "正在出票中...", //标题
orderId: "", //订单Id orderId: "", //订单Id
status: "", //出票状态 status: "", //出票状态
timer: "", //计时器 timer: "", //计时器
...@@ -26,32 +26,18 @@ ...@@ -26,32 +26,18 @@
this.orderId = option.orderId||'' this.orderId = option.orderId||''
this.afterBuyUrl = option.afterBuyUrl||'' this.afterBuyUrl = option.afterBuyUrl||''
this.ifyukuaiCode=option.ifyukuaiCode||'' this.ifyukuaiCode=option.ifyukuaiCode||''
let sum = 0 this.ticketStatus()
let intFun=()=>{ //页面初始化 let intFun=()=>{ //页面初始化
this.timer = setTimeout(()=>{ this.timer = setTimeout(()=>{
sum += 300
if (sum > 300) {
sum += 700
}
if (this.status == "2" || this.status == "4" || this.status == "5") { if (this.status == "2" || this.status == "4" || this.status == "5") {
uni.redirectTo({
url:this.afterBuyUrl+'?orderId=' + this.orderId+'&ifyukuaiCode='+this.ifyukuaiCode
})
return return
} }
if (this.status == "3") { if (this.status == "3") {
this.title = "出票失败..."
this.loadImg = false
return
}
if (sum > 10000) {
this.title = "出票失败..."
this.loadImg = false
return return
} }
this.ticketStatus() this.ticketStatus()
intFun() intFun()
}, sum) }, 1200)
} }
intFun() intFun()
}, },
...@@ -74,6 +60,15 @@ ...@@ -74,6 +60,15 @@
this.$request("order/order/getStatusById", data).then((res) => { this.$request("order/order/getStatusById", data).then((res) => {
if (res.code == "00") { if (res.code == "00") {
this.status = res.data this.status = res.data
if (this.status == "2" || this.status == "4" || this.status == "5") {
uni.redirectTo({
url:this.afterBuyUrl+'?orderId=' + this.orderId+'&ifyukuaiCode='+this.ifyukuaiCode
})
}
if (this.status == "3") {
this.title = "出票失败..."
this.loadImg = false
}
} else { } else {
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
......
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