Commit 11bf8463 authored by 潘永坪's avatar 潘永坪

产品选择页面开发

parent 995c4ad1
export default{
getCurrentPageUrl(){//---获取当前页面url
let pages = getCurrentPages() //获取加载的页面
let currentPage = pages[pages.length-1] //获取当前页面的对象
let url = currentPage.route //当前页面url
let options = currentPage.options //如果要获取url中所带的参数可
let queryTotal=""
for (let key in options){
queryTotal+="&"+key+"="+options[key]
}
queryTotal=queryTotal.substr(1)
let pageUrl=url+"?"+queryTotal//请求的全路径
return pageUrl
},
today:function(){//默认当天
var now = new Date();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
return today
},
todayTime:function(){
var now = new Date();
var hour = now.getHours()<10?'0'+now.getHours():now.getHours()
var minutes = now.getMinutes()<10?'0'+now.getMinutes():now.getMinutes()
var seconds = now.getSeconds()<10?'0'+now.getSeconds():now.getSeconds()
var time = hour+":"+minutes+":"+seconds
return time
},
dateDifference:function(start,end){//结束日期与开始日期相差几天
var strSeparator = "-";
var oDate1= start.split(strSeparator);
var oDate2= end.split(strSeparator);
var strDateS = new Date(oDate1[0], oDate1[1]-1, oDate1[2]);
var strDateE = new Date(oDate2[0], oDate2[1]-1, oDate2[2]);
getCurrentPageUrl(){//---获取当前页面url
let pages = getCurrentPages() //获取加载的页面
let currentPage = pages[pages.length-1] //获取当前页面的对象
let url = currentPage.route //当前页面url
let options = currentPage.options //如果要获取url中所带的参数可
let queryTotal=''
for (let key in options){
queryTotal+='&'+key+'='+options[key]
}
queryTotal=queryTotal.substr(1)
let pageUrl=url+'?'+queryTotal//请求的全路径
return pageUrl
},
today:function(){//默认当天
var now = new Date()
var day = ('0' + now.getDate()).slice(-2)
var month = ('0' + (now.getMonth() + 1)).slice(-2)
var today = now.getFullYear()+'-'+(month)+'-'+(day)
return today
},
todayTime:function(){
var now = new Date()
var hour = now.getHours()<10?'0'+now.getHours():now.getHours()
var minutes = now.getMinutes()<10?'0'+now.getMinutes():now.getMinutes()
var seconds = now.getSeconds()<10?'0'+now.getSeconds():now.getSeconds()
var time = hour+':'+minutes+':'+seconds
return time
},
dateDifference:function(start,end){//结束日期与开始日期相差几天
var strSeparator = '-'
var oDate1= start.split(strSeparator)
var oDate2= end.split(strSeparator)
var strDateS = new Date(oDate1[0], oDate1[1]-1, oDate1[2])
var strDateE = new Date(oDate2[0], oDate2[1]-1, oDate2[2])
var iDays = parseInt((strDateE- strDateS) / 1000 / 60 / 60 /24)
return iDays
}
},
changeTime:function(option) {//把时间格式转化成数字
// currentTime当前时间,假设是 2019-7-2 19:03
var currentTime = option
var reg = new RegExp('-','g')//去掉时间里面的-
var a = currentTime.replace(reg,'')
var regs = new RegExp(' ','g')//去掉时间里面的空格
var b = a.replace(regs,'')
var regss = new RegExp(':','g')//去掉时间里面的:冒号
var c = b.replace(regss,'')
return c
}
}
//调用方法时--this.$commonjs.today()
\ No newline at end of file
<template>
<u-popup v-model="showPop" mode="bottom" border-radius="14" closeable height="85%">
<view class="son-wrap">
<view class="head">
<view class="head1">
购买须知
</view>
<view class="head2">
{{buyKnowData.name}}
</view>
<view class="head3">
挂牌价:¥{{buyKnowData.originalPrice}}
</view>
</view>
<view class="middle">
<view class="middle-list" v-for="(item,a) of buyKnowData.productTitleResVos" :key="a">
<view class="middle-title">
{{item.title}}
</view>
<view class="middle-content" v-for="(items,b) of item.productChildTitleData" :key="b">
<text>
{{items.title}}
</text>
<view>
<!--<text>随买随用</text>-->
<text v-for="(itemss,c) of items.contentList" :key="c" class="content-child">
{{itemss.content}}
</text>
</view>
</view>
</view>
</view>
<view class="bottom">
<text class="bottom-left">
¥ <text>{{buyKnowData.sellingPrice}}</text>
</text>
<view class="bottom-right">
<text class="btn" @click="showPop=false">
去预订
</text>
</view>
</view>
</view>
</u-popup>
</template>
<script>
export default {
props: ['buyKnowData'],
data() {
return {
showPop: false, //控制弹窗显示隐藏
}
},
methods: {
}
}
</script>
<style scoped="scoped">
.son-wrap{
font-size: 24rpx;
position: relative;
}
.head {
padding: 100rpx 24rpx 0 24rpx;
}
.head1{
text-align: center;
font-size: 32rpx;
font-weight: bold;
text-align: center;
padding: 30rpx 0;
position:fixed;
top: 0;
width: 100%;
background: #fff;
z-index: 1;
}
.head2{
font-weight: bolder;
font-size: 32rpx;
line-height: 40rpx;
}
.head3{
font-size: 28rpx;
margin-top: 20rpx;
color: #666666;
border-bottom: 1px solid #e6e6e6;
padding-bottom: 30rpx;
}
.middle {
padding-bottom: 100rpx;
font-size: 28rpx;
}
.middle-list {
margin: 30rpx 24rpx;
padding-bottom: 24rpx;
border-bottom: 1px solid #E6E6E6;
}
.middle-title{
font-size: 32rpx;
font-weight: bold;
}
.middle-content {
display: flex;
margin-top: 30rpx;
position: relative;
}
.middle-content>text {
color: #666666;
margin-right: 30rpx;
width: 120rpx;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
flex-shrink: 0;
font-size: 26rpx;
position: relative;
}
.middle-content view {
display: flex;
flex-direction: column;
justify-content: center;
}
.bottom {
display: flex;
justify-content: space-between;
padding: 0 24rpx;
height: 100rpx;
align-items: center;
position: fixed;
bottom: 0;
width: 100%;
z-index: 9;
background: #FFFFFF;
box-sizing: border-box;
}
.bottom-left{
color: #f9690e;
}
.bottom-left text {
font-size: 36rpx;
font-weight: bolder;
}
.bottom view {
display: flex;
align-items: center;
}
.btn{
padding: 16rpx 48rpx;
border-radius: 20rpx;
font-size: 32rpx;
}
</style>
<template>
<!-- 客服 -->
<u-popup v-model="showPop" mode="bottom" border-radius="14" closeable >
<view class="wrap">
<u-popup v-model="showPop" mode="bottom" border-radius="14" closeable height="85%">
<view class="son-wrap">
<view class="title">
客服电话
</view>
......@@ -40,6 +40,9 @@ export default{
</script>
<style scoped lang="scss">
.son-wrap{
position: relative;
}
.title{
text-align: center;
font-size: 32rpx;
......@@ -62,26 +65,5 @@ export default{
align-items: center;
justify-content: space-between;
}
.wrap{
overflow-y: auto;
position: relative;
}
@media only screen and (max-height: 900px) {
.wrap{
max-height: 750px;
}
}
@media only screen and (max-height: 750px) {
.wrap{
max-height: 600px;
}
}
@media only screen and (max-height: 600px) {
.wrap{
max-height: 500px;
}
}
</style>
\ No newline at end of file
<template>
<!-- 商家详情弹窗 -->
<u-popup v-model="showPop" mode="bottom" border-radius="14" closeable >
<view class="buy-wrap">
<u-popup v-model="showPop" mode="bottom" border-radius="14" closeable height="85%">
<view class="son-wrap">
<view class="head">
{{detailData.name}}
</view>
......@@ -155,7 +155,10 @@ export default {
}
</script>
<style scoped="scoped">
<style scoped="scoped" lang="scss">
.son-wrap{
position: relative;
}
.head{
text-align: center;
font-size: 32rpx;
......@@ -228,26 +231,4 @@ export default {
white-space: nowrap;
margin-right: 10rpx;
}
.buy-wrap{
overflow-y: auto;
position: relative;
}
@media only screen and (max-height: 900px) {
.buy-wrap{
max-height: 750px;
}
}
@media only screen and (max-height: 750px) {
.buy-wrap{
max-height: 600px;
}
}
@media only screen and (max-height: 600px) {
.buy-wrap{
max-height: 500px;
}
}
</style>
\ No newline at end of file
......@@ -41,4 +41,27 @@ Number.prototype.toFixed=function (d) {
return (pm+s).replace(/\.$/,'')
}return this+''
}
// 时间格式化
Date.prototype.Format = function(fmt) {
var o = {
'M+': this.getMonth() + 1, // 月份
'd+': this.getDate(), // 日
'h+': this.getHours(), // 小时
'm+': this.getMinutes(), // 分
's+': this.getSeconds(), // 秒
'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
S: this.getMilliseconds() // 毫秒
}
if (/(y+)/.test(fmt))
fmt = fmt.replace(
RegExp.$1,
(this.getFullYear() + '').substr(4 - RegExp.$1.length)
)
for (var k in o)
if (new RegExp('(' + k + ')').test(fmt))
fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
)
return fmt
} //调用new Date().Format("yyyy-MM-dd hh:mm");
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