Commit ac4d03ff authored by 潘永坪's avatar 潘永坪

个人中心分包

parent 650acd9c
...@@ -42,20 +42,7 @@ ...@@ -42,20 +42,7 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/my/order/electronicTicket/electronicTicket",
"style": {
"navigationBarTitleText": "电子门票",
"enablePullDownRefresh": false
}
},
{
"path": "pages/my/order/productList/productList",
"style": {
"navigationBarTitleText": "我的订单",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/combination/sourceCombiChoose/sourceCombiChoose", "path": "pages/combination/sourceCombiChoose/sourceCombiChoose",
"style": { "style": {
...@@ -70,15 +57,6 @@ ...@@ -70,15 +57,6 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/my/order/intelTicket/intelTicket",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/combination/combiOrder/combiOrder", "path": "pages/combination/combiOrder/combiOrder",
"style": { "style": {
...@@ -86,13 +64,7 @@ ...@@ -86,13 +64,7 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/my/order/orderList/orderList",
"style": {
"navigationBarTitleText": "订单列表",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/common/coupon/coupon", "path": "pages/common/coupon/coupon",
"style": { "style": {
...@@ -114,7 +86,7 @@ ...@@ -114,7 +86,7 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path": "pages/indexs/dongjianIndex/dongjianIndex", "path": "pages/indexs/dongjianIndex/dongjianIndex",
"style": { "style": {
...@@ -122,13 +94,7 @@ ...@@ -122,13 +94,7 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/my/order/afterSale/applyAfterSale/applyAfterSale",
"style": {
"navigationBarTitleText": "售后",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/indexs/hghgIndex/hghgIndex", "path": "pages/indexs/hghgIndex/hghgIndex",
"style": { "style": {
...@@ -136,13 +102,7 @@ ...@@ -136,13 +102,7 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/my/exchangeCode/exchangeIndex/exchangeIndex",
"style": {
"navigationBarTitleText": "兑换",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/common/simpleProduct/simpleProduct", "path": "pages/common/simpleProduct/simpleProduct",
"style": { "style": {
...@@ -180,339 +140,390 @@ ...@@ -180,339 +140,390 @@
} }
}, { }, {
"path": "pages/my/center/center", "path": "pages/payment/changeNumPayment/changeNumPayment",
"style": {
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false
}
}, {
"path": "pages/my/shopCart/shopCart",
"style": {
"navigationBarTitleText": "购物车",
"enablePullDownRefresh": false
}
}, {
"path": "pages/my/commonInfo/commonInfo",
"style": {
"navigationBarTitleText": "常用信息",
"enablePullDownRefresh": false
}
}, {
"path": "pages/my/passCode/codeResult/codeResult",
"style": { "style": {
"navigationBarTitleText": "通行码", "navigationBarTitleText": "支付",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
}, { {
"path": "pages/my/customerService/enterpriseWechat/enterpriseWechat", "path": "pages/my/center/center",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/my/couponCenter/myCouponList/myCouponList",
"style": {
"navigationBarTitleText": "我的券列表",
"enablePullDownRefresh": false
}
}, {
"path": "pages/my/travelList/travelList/travelList",
"style": {
"navigationBarTitleText": "行程单",
"enablePullDownRefresh": false
}
}, {
"path": "pages/my/travelNotes/myTravelogue/myTravelogue",
"style": {
"navigationBarTitleText": "我的行记",
"enablePullDownRefresh": false
}
}, {
"path": "pages/my/order/afterSale/afterSaleList/afterSaleList",
"style": { "style": {
"navigationBarTitleText": "售后列表", "navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
], ],
//分包加载配置,此配置为小程序的分包加载机制。 //分包加载配置,此配置为小程序的分包加载机制。
"subPackages": [ "subPackages": [{
{ "root": "pages/my", //个人中心分包
"root": "pages/scenic", //子包的根目录
"pages": [ "pages": [
{ {
"path": "scenicJointOrder/scenicJointOrder", "path": "order/electronicTicket/electronicTicket",
"style": { "style": {
"navigationBarTitleText": "订单填写", "navigationBarTitleText": "电子门票",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path": "scenicSingleOrder/scenicSingleOrder", "path": "order/productList/productList",
"style": { "style": {
"navigationBarTitleText": "订单填写", "navigationBarTitleText": "我的订单",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path": "scenicProduct/scenicProduct", "path": "order/intelTicket/intelTicket",
"style": { "style": {
"navigationBarTitleText": "产品", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { },
"path": "combinationProduct/combinationProduct", {
"style": { "path": "order/orderList/orderList",
"navigationBarTitleText": "产品选择", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "订单列表",
} "enablePullDownRefresh": false
}
}, { },
"path": "scenicIndex/scenicIndex", {
"style": { "path": "order/afterSale/applyAfterSale/applyAfterSale",
"navigationBarTitleText": "景区", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "售后",
} "enablePullDownRefresh": false
} }
] },
}, {
{ "path": "exchangeCode/exchangeIndex/exchangeIndex",
"root": "pages/vlog", "style": {
"pages": [{ "navigationBarTitleText": "兑换",
"path": "vlogIndex/vlogIndex", "enablePullDownRefresh": false
"style": { }
"navigationBarTitleText": "欢乐影集", }, {
"enablePullDownRefresh": false, "path": "shopCart/shopCart",
"navigationBarBackgroundColor": "#ffffff", "style": {
"navigationBarTextStyle": "black" "navigationBarTitleText": "购物车",
} "enablePullDownRefresh": false
}, }
{
"path": "vlogface/vlogface", }, {
"style": { "path": "commonInfo/commonInfo",
"navigationBarTitleText": "扫脸获取视频", "style": {
"enablePullDownRefresh": false, "navigationBarTitleText": "常用信息",
"navigationBarBackgroundColor": "#ffffff", "enablePullDownRefresh": false
"navigationBarTextStyle": "black" }
}
}, }, {
{ "path": "passCode/codeResult/codeResult",
"path": "scenicList/scenicList", "style": {
"style": { "navigationBarTitleText": "通行码",
"enablePullDownRefresh": false, "enablePullDownRefresh": false
"backgroundColor": "#192033" }
}
}, }, {
{ "path": "customerService/enterpriseWechat/enterpriseWechat",
"path": "vlogList/vlogList", "style": {
"style": { "navigationBarTitleText": "",
"navigationBarTitleText": "我的Vlog集", "enablePullDownRefresh": false
"enablePullDownRefresh": false, }
"backgroundColor": "#192033"
} }, {
}, "path": "couponCenter/myCouponList/myCouponList",
{ "style": {
"path": "share/share", "navigationBarTitleText": "我的券列表",
"style": { "enablePullDownRefresh": false
"navigationBarTitleText": "Vlog", }
"enablePullDownRefresh": false
} }, {
}, "path": "travelList/travelList/travelList",
{ "style": {
"path": "myVlog/myVlog", "navigationBarTitleText": "行程单",
"style": { "enablePullDownRefresh": false
"navigationBarTitleText": "我的Vlog集", }
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#fff", }, {
"navigationBarTextStyle": "black" "path": "travelNotes/myTravelogue/myTravelogue",
} "style": {
}, "navigationBarTitleText": "我的行记",
{ "enablePullDownRefresh": false
"path": "product/product", }
"style": {
"navigationBarTitleText": "产品列表", }, {
"enablePullDownRefresh": false, "path": "order/afterSale/afterSaleList/afterSaleList",
"navigationBarBackgroundColor": "#fff", "style": {
"navigationBarTextStyle": "black" "navigationBarTitleText": "售后列表",
} "enablePullDownRefresh": false
}, }
{
"path": "productDetails/productDetails", }
"style": { ]
"navigationBarTitleText": "产品详情", },
"enablePullDownRefresh": false, {
"navigationBarBackgroundColor": "#fff", "root": "pages/scenic", //景区分包
"navigationBarTextStyle": "black" "pages": [{
} "path": "scenicJointOrder/scenicJointOrder",
}, "style": {
{ "navigationBarTitleText": "订单填写",
"path": "uploadPictures/uploadPictures", "enablePullDownRefresh": false
"style": { }
"navigationBarTitleText": "上传照片", },
"enablePullDownRefresh": false, {
"navigationBarBackgroundColor": "#fff", "path": "scenicSingleOrder/scenicSingleOrder",
"navigationBarTextStyle": "black" "style": {
} "navigationBarTitleText": "订单填写",
}, "enablePullDownRefresh": false
{ }
"path": "u-avatar-cropper/u-avatar-cropper", },
"style": { {
"navigationBarTitleText": "照片裁剪", "path": "scenicProduct/scenicProduct",
"navigationBarBackgroundColor": "#000000" "style": {
} "navigationBarTitleText": "产品",
}, "enablePullDownRefresh": false
{ }
"path": "pictureFormat/pictureFormat", }, {
"style": { "path": "combinationProduct/combinationProduct",
"navigationBarTitleText": "照片调整", "style": {
"enablePullDownRefresh": false, "navigationBarTitleText": "产品选择",
"navigationBarBackgroundColor": "#ffffff", "enablePullDownRefresh": false
"navigationBarTextStyle": "black" }
}
},
{
"path": "myVlogPhotos/myVlogPhotos",
"style": {
"navigationBarTitleText": "我的vlog照片",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},
{
"path": "orderPay/orderPay",
"style": {
"navigationBarTitleText": "确认订单",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},
{
"path": "shippingAddress/shippingAddress",
"style": {
"navigationBarTitleText": "填写收货地址",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
}
]
},
{
"root": "pages/album",
"pages": [{
"path": "albumIndex",
"style": {
"navigationBarTitleText": "相册首页",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "chooseFavorite",
"style": {
"navigationBarTitleText": "景区喜好",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "getPortrait",
"style": {
"navigationBarTitleText": "获取人像",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "myPhotoAlbum/myPhotoAlbum",
"style": {
"navigationBarTitleText": "我的相册",
"enablePullDownRefresh": false
}
}, { }, {
"path": "albumOrderdetail/albumOrderdetail", "path": "scenicIndex/scenicIndex",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "景区",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}
]
},
{
"root": "pages/vlog", //vlogo分包
"pages": [{
"path": "vlogIndex/vlogIndex",
"style": {
"navigationBarTitleText": "欢乐影集",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},
{
"path": "vlogface/vlogface",
"style": {
"navigationBarTitleText": "扫脸获取视频",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},
{
"path": "scenicList/scenicList",
"style": {
"enablePullDownRefresh": false,
"backgroundColor": "#192033"
}
},
{
"path": "vlogList/vlogList",
"style": {
"navigationBarTitleText": "我的Vlog集",
"enablePullDownRefresh": false,
"backgroundColor": "#192033"
}
},
{
"path": "share/share",
"style": {
"navigationBarTitleText": "Vlog",
"enablePullDownRefresh": false
}
},
{
"path": "myVlog/myVlog",
"style": {
"navigationBarTitleText": "我的Vlog集",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
}
},
{
"path": "product/product",
"style": {
"navigationBarTitleText": "产品列表",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
}
},
{
"path": "productDetails/productDetails",
"style": {
"navigationBarTitleText": "产品详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
}
},
{
"path": "uploadPictures/uploadPictures",
"style": {
"navigationBarTitleText": "上传照片",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
}
},
{
"path": "u-avatar-cropper/u-avatar-cropper",
"style": {
"navigationBarTitleText": "照片裁剪",
"navigationBarBackgroundColor": "#000000"
}
},
{
"path": "pictureFormat/pictureFormat",
"style": {
"navigationBarTitleText": "照片调整",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},
{
"path": "myVlogPhotos/myVlogPhotos",
"style": {
"navigationBarTitleText": "我的vlog照片",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},
{
"path": "orderPay/orderPay",
"style": {
"navigationBarTitleText": "确认订单",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},
{
"path": "shippingAddress/shippingAddress",
"style": {
"navigationBarTitleText": "填写收货地址",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
}
]
},
{
"root": "pages/album", //影集分包
"pages": [{
"path": "albumIndex",
"style": {
"navigationBarTitleText": "相册首页",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "chooseFavorite",
"style": {
"navigationBarTitleText": "景区喜好",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "getPortrait",
"style": {
"navigationBarTitleText": "获取人像",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "myPhotoAlbum/myPhotoAlbum",
"style": {
"navigationBarTitleText": "我的相册",
"enablePullDownRefresh": false
}
}, { }, {
"path": "purchasedPhotoAlbum/purchasedPhotoAlbum", "path": "albumOrderdetail/albumOrderdetail",
"style": { "style": {
"navigationBarTitleText": "我的影集", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { }, {
"path": "DIYPurchase/DIYPurchase", "path": "purchasedPhotoAlbum/purchasedPhotoAlbum",
"style": { "style": {
"navigationBarTitleText": "影像DIY", "navigationBarTitleText": "我的影集",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { }, {
"path": "DIYDetails/DIYDetails", "path": "DIYPurchase/DIYPurchase",
"style": { "style": {
"navigationBarTitleText": "我的相片", "navigationBarTitleText": "影像DIY",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "DIYDetails/DIYDetails",
"style": {
"navigationBarTitleText": "我的相片",
"enablePullDownRefresh": false
} }
]
} }
], ]
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#192033",
"backgroundColor": "#F8F8F8"
},
// 配置tabbar导航栏
"tabBar": {
"color": "#7A7E83", //字体颜色
"selectedColor": "#007AFF", //选中时字体颜色
"borderStyle": "black", //底部的上边框线条
"backgroundColor": "#F8F8F8", //底部背景色
"fontSize": "18px", //字体大小
"spacing": "10px", //字体到图标的距离
"iconWidth": "16px",
"list": [{
"pagePath": "pages/indexs/index/index",
"iconPath": "static/img/index/home.png",
"selectedIconPath": "static/img/index/homeChoose.png",
"text": "首页"
}, {
"pagePath": "pages/my/center/center",
"iconPath": "static/img/index/my.png",
"selectedIconPath": "static/img/index/myChoose.png",
"text": "我的"
}]
},
"condition": {
//模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "", //模式名称
"path": "", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
},
"easycom": {
// 下载安装的方式需要前面的"@/",npm安装的方式无需"@/"
// 下载安装方式
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
} }
],
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#192033",
"backgroundColor": "#F8F8F8"
},
// 配置tabbar导航栏
"tabBar": {
"color": "#7A7E83", //字体颜色
"selectedColor": "#007AFF", //选中时字体颜色
"borderStyle": "black", //底部的上边框线条
"backgroundColor": "#F8F8F8", //底部背景色
"fontSize": "18px", //字体大小
"spacing": "10px", //字体到图标的距离
"iconWidth": "16px",
"list": [{
"pagePath": "pages/indexs/index/index",
"iconPath": "static/img/index/home.png",
"selectedIconPath": "static/img/index/homeChoose.png",
"text": "首页"
}, {
"pagePath": "pages/my/center/center",
"iconPath": "static/img/index/my.png",
"selectedIconPath": "static/img/index/myChoose.png",
"text": "我的"
}]
},
"condition": {
//模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "", //模式名称
"path": "", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
},
"easycom": {
// 下载安装的方式需要前面的"@/",npm安装的方式无需"@/"
// 下载安装方式
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
} }
// npm安装方式 }
// "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" // npm安装方式
\ No newline at end of file // "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
\ No newline at end of file
<template>
<!-- 传入价格,通过改变数量改变价格的支付页面 -->
<view class="wrap">
<view class="top">
<view class="name">
皇冠大扶梯
</view>
<view class="number">
<text>
购买数量
</text>
<u-number-box
v-model="buyNumber"
bg-color='#3688FF'
color='#ffffff'
:input-height="60"
size='28'>
</u-number-box>
</view>
<view class="price">
<text>
总价
</text>
<text>
¥6.00
</text>
</view>
<view class="remark">
<input placeholder="添加备注(20字以内)" maxlength="20" v-model.trim="remark" style="margin-bottom:20rpx;" />
</view>
<view class="tips">
温馨提示:请核对以上付款金额、付款对象等信息与交易匹配。
</view>
</view>
<view class="bottom">
<text class="btn">立即支付</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
remark:'',//备注
payType:'',//支付方式
buyNumber:'',//购买数量
}
},
onLoad(option) {
//#ifdef MP-WEIXIN
this.payType = 42
//#endif
//#ifdef MP-ALIPAY
this.payType = 33
//#endif
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.wrap{
height: 100%;
background: #ffffff;
}
.top{
padding: 40rpx 24rpx;
}
.name{
font-size: 32rpx;
font-weight: bold;
color: #191919;
text-align: center;
}
.number{
display: flex;
justify-content: space-between;
font-weight: bold;
margin-top: 80rpx;
align-items: center;
}
.price{
display: flex;
justify-content: space-between;
font-weight: bold;
margin-top: 48rpx;
text:nth-child(2){
font-size: 40rpx;
color: $red;
}
}
.remark{
margin-top: 48rpx;
color: $grey;
}
.tips{
margin-top: 24rpx;
color: $grey;
font-size: 24rpx;
}
.bottom{
position: fixed;
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
bottom: 0;
box-shadow: 0px -4px 12px 2px rgba(0,0,0,0.08);
background: #ffffff;
}
.btn{
display: flex;
align-items: center;
justify-content: center;
width: 90%;
height: 80rpx;
background: #3688FF;
border-radius: 8rpx;
font-size: 32rpx;
font-weight: bold;
}
</style>
...@@ -2,552 +2,587 @@ ...@@ -2,552 +2,587 @@
<view class="bigBox"> <view class="bigBox">
<view class="top"> <view class="top">
<view class="topName"> <view class="topName">
<text class="topIcon"> <text>{{ name }}</text>
<text class="iconfont icon-tubiaolunkuo-"></text>
</text>
<text>{{name}}</text>
</view> </view>
<view class="topMoney"> <view class="topMoney">
<text class="moneyText">金额</text> <view class="moneyText">
付款金额
</view>
<view class="moneyNumber"> <view class="moneyNumber">
<text class="iconfont icon-fl-renminbi" style="font-size: 56rpx;"></text> <text class="iconfont icon-fl-renminbi" style="font-size: 56rpx"></text>
<text>{{buyMoney}}</text> <text>{{ buyMoney }}</text>
<text></text> <text></text>
</view> </view>
</view> </view>
<!-- -----------------------------有可用优惠券,并且未选中----------------------------------------------------- --> <!-- -----------------------------有可用优惠券,并且未选中----------------------------------------------------- -->
<view class="topCoupon" v-if="couponData.masterSlaveCouponList&&couponData.masterSlaveCouponList.length>0&&chooseCouponObj==''" @click="showCoupon()"> <view
<view class="couponLeft"> class="topCoupon"
v-if="couponData.masterSlaveCouponList && couponData.masterSlaveCouponList.length > 0 && chooseCouponObj == ''"
@click="showCoupon()"
>
<view class="couponLeft">
<text></text> <text></text>
<text>{{couponData.masterSlaveCouponList[0].couponName}}</text> <text>{{ couponData.masterSlaveCouponList[0].couponName }}</text>
</view> </view>
<view class="couponRight"> <view class="couponRight">
<text>未选优惠券</text> <text>未选优惠券</text>
<text class="iconfont icon-you" style="font-size:32rpx;"></text> <text class="iconfont icon-you" style="font-size: 32rpx"></text>
</view> </view>
</view> </view>
<!-- -----------------------------有可用优惠券----------------------------------------------------- --> <!-- -----------------------------有可用优惠券----------------------------------------------------- -->
<view class="topCoupon" v-if="chooseCouponObj!=''&&savedMoney>0" @click="showCoupon()"> <view class="topCoupon" v-if="chooseCouponObj != '' && savedMoney > 0" @click="showCoupon()">
<view class="couponLeft"> <view class="couponLeft">
<text></text> <text></text>
<text>{{chooseCouponObj.couponName}}</text> <text>{{ chooseCouponObj.couponName }}</text>
</view> </view>
<view class="couponRight"> <view class="couponRight">
<text>-</text> <text>-</text>
<text>{{parseFloat(savedMoney.toFixed(2))}}</text> <text>{{ parseFloat(savedMoney.toFixed(2)) }}</text>
<text class="iconfont icon-you" style="font-size:32rpx;"></text> <text class="iconfont icon-you" style="font-size: 32rpx"></text>
</view> </view>
</view> </view>
<!-- -----------------------------------------------可用优惠券条件--------------------------------------- --> <!-- -----------------------------------------------可用优惠券条件--------------------------------------- -->
<view class="topCoupon" v-if="ableConpon!=''" @click="showCoupon()"> <view class="topCoupon" v-if="ableConpon != ''" @click="showCoupon()">
<view class="couponLeft"> <view class="couponLeft">
<text></text> <text></text>
<text>{{ableConpon.couponName}}</text> <text>{{ ableConpon.couponName }}</text>
</view> </view>
<view class="couponRight"> <view class="couponRight">
<text>{{ableConpon.couponRule}}</text> <text>{{ ableConpon.couponRule }}</text>
<text class="iconfont icon-you" style="font-size:32rpx;"></text> <text class="iconfont icon-you" style="font-size: 32rpx"></text>
</view> </view>
</view> </view>
</view> </view>
<view class="middle"> <view class="middle">
友情提示:请核对以上付款金额、付款商户等信息与交易一致。经您确认支付的金额,商家不会退回亦无赔偿义务。 <view>
<input placeholder="添加备注(20字以内)" maxlength="20" v-model.trim="remark" style="margin-bottom:20rpx;" />
</view>
<view style="font-size:24rpx;">
温馨提示:请核对以上付款金额、付款对象等信息与交易匹配。
</view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="botLeft"> <view class="botLeft">
<view v-for="(item,index) of leftList" :key="index"> <view v-for="(item, index) of leftList" :key="index">
<text @click="clickNum(items.text,index,a)" v-for="(items,a) of item.child" :key="a" :style="{'background':items.background}">{{items.text}}</text> <text @click="clickNum(items.text, index, a)" v-for="(items, a) of item.child" :key="a" :style="{ background: items.background }">{{
items.text
}}</text>
</view> </view>
</view> </view>
<view class="botRight"> <view class="botRight">
<view class="rightOne" @click="clickEnter()" :style="{'background':spaceBackground}"> <view class="rightOne" @click="clickEnter()" :style="{ background: spaceBackground }">
<text class="iconfont icon-im_huige" style="font-size:70rpx;"></text> <text class="iconfont icon-im_huige" style="font-size: 70rpx"></text>
</view> </view>
<view class="rightTwo" ref="pay" @click="clickPay()" :style="{'background':payBackground}"> <view class="rightTwo" ref="pay" @click="clickPay()" :style="{ background: payBackground }">
<view>立即</view> <view>立即</view>
<view>支付</view> <view>支付</view>
</view> </view>
</view> </view>
</view> </view>
<!-------------------------------------------券弹窗------------------------------> <!-------------------------------------------券弹窗------------------------------>
<orderCoupon :couponData="couponData" ref="orderCoupon" @couponChoose="couponChoose" :chooseCouponObj="chooseCouponObj"></orderCoupon> <orderCoupon :couponData="couponData" ref="orderCoupon" @couponChoose="couponChoose" :chooseCouponObj="chooseCouponObj"></orderCoupon>
</view> </view>
</template> </template>
<script> <script>
import orderCoupon from '@/components/orderCoupon.vue' import orderCoupon from '@/components/orderCoupon.vue'
export default { export default {
components:{ components: {
orderCoupon orderCoupon
}, },
data() { data() {
return { return {
enterUrl:'',//进入页面路由 remark:'',//备注
buyMoney:'', //输入金额 enterUrl: '', //进入页面路由
buyMoney: '', //输入金额
companyId: '', //公司Id companyId: '', //公司Id
merchantId: '', //商户Id merchantId: '', //商户Id
name: '', //商家名称 name: '', //商家名称
payType:'',//支付类型,微信小程序42,支付宝小程序33 payType: '', //支付类型,微信小程序42,支付宝小程序33
paySign: '', //签名 paySign: '', //签名
signType: '', //签名方式 signType: '', //签名方式
timeStamp: '', //时间戳 timeStamp: '', //时间戳
nonceStr: '', //随机字符串 nonceStr: '', //随机字符串
package: '', //订单详情扩展字符串 package: '', //订单详情扩展字符串
orderInfo:'',//支付宝订单号 orderInfo: '', //支付宝订单号
flag: '', //setTimeout函数 flag: '', //setTimeout函数
couponData: '', //所有劵数据 couponData: '', //所有劵数据
chooseCouponObj: '', //默认选中最优价格优惠券 chooseCouponObj: '', //默认选中最优价格优惠券
savedMoney:0,//优惠金额 savedMoney: 0, //优惠金额
ableConpon: '', //没有可用优惠券时,达到一定条件可用,显示达到的条件 ableConpon: '', //没有可用优惠券时,达到一定条件可用,显示达到的条件
orderSource:8,//1公众号平台、2公众号组合页面1、3公众号组合页面2、4胖丁伙伴app、5第三方自助机、6第三方票房窗口、7平台快捷买单、8扫码支付 orderSource: 8, //1公众号平台、2公众号组合页面1、3公众号组合页面2、4胖丁伙伴app、5第三方自助机、6第三方票房窗口、7平台快捷买单、8扫码支付
background:'',//普通按钮背景颜色 background: '', //普通按钮背景颜色
spaceBackground:'',//回格按钮背景颜色 spaceBackground: '', //回格按钮背景颜色
payBackground:'#1dce2e',//支付背景颜色 payBackground: '#3688FF', //支付背景颜色
leftList:[//左侧按钮数据 leftList: [
//左侧按钮数据
{ {
child:[ child: [
{text:1,background:''}, { text: 1, background: '' },
{text:2,background:''}, { text: 2, background: '' },
{text:3,background:''} { text: 3, background: '' }
] ]
}, },
{ {
child:[ child: [
{text:4,background:''}, { text: 4, background: '' },
{text:5,background:''}, { text: 5, background: '' },
{text:6,background:''}, { text: 6, background: '' }
] ]
}, },
{ {
child:[ child: [
{text:7,background:''}, { text: 7, background: '' },
{text:8,background:''}, { text: 8, background: '' },
{text:9,background:''}, { text: 9, background: '' }
] ]
}, },
{ {
child:[ child: [
{text:0,background:''}, { text: 0, background: '' },
{text:'.',background:''}, { text: '.', background: '' }
] ]
} }
], ],
orderId:'',//订单Id orderId: '', //订单Id
paydJumpUrl:'',//页面跳转路径 paydJumpUrl: '', //页面跳转路径
companyAttribute:'',//等于5时为出租车 companyAttribute: '', //等于5时为出租车
timer:null,//定时器 timer: null, //定时器
extendInfo:''//额外信息 extendInfo: '' //额外信息
} }
}, },
onLoad(option) { onLoad(option) {
//#ifdef MP-WEIXIN //#ifdef MP-WEIXIN
this.enterUrl=option.q this.enterUrl = option.q
this.payType = 42 this.payType = 42
//#endif //#endif
//#ifdef MP-ALIPAY //#ifdef MP-ALIPAY
this.enterUrl=uni.getStorageSync('alipayQrCode') this.enterUrl = uni.getStorageSync('alipayQrCode')
uni.removeStorageSync('alipayQrCode')//临时解决出租车扫码之后跳转到组合票时,参数会有问题,有时间再根本解决 uni.removeStorageSync('alipayQrCode') //临时解决出租车扫码之后跳转到组合票时,参数会有问题,有时间再根本解决
this.payType = 33 this.payType = 33
//#endif //#endif
if(this.enterUrl){//扫普通二维码进入 if (this.enterUrl) {
this.merchantId=this.getUrlKey('merchantId') //扫普通二维码进入
this.companyId=this.getUrlKey('companyId') this.merchantId = this.getUrlKey('merchantId')
this.extendInfo=this.getUrlKey('extendInfo') this.companyId = this.getUrlKey('companyId')
}else{//扫小程序二维码进入 this.extendInfo = this.getUrlKey('extendInfo')
this.merchantId=option.merchantId } else {
this.companyId=option.companyId //扫小程序二维码进入
this.extendInfo=option.extendInfo this.merchantId = option.merchantId
this.companyId = option.companyId
this.extendInfo = option.extendInfo
} }
if(uni.getStorageSync('openid')){ if (uni.getStorageSync('openid')) {
this.openid=uni.getStorageSync('openid') this.openid = uni.getStorageSync('openid')
this.getUserBrowse() if (this.merchantId) {
if (this.merchantId) { //大商家的有merchantId //大商家的有merchantId
this.init() this.init()
} else { //小商家没有merchantId } else {
this.initTwo() //小商家没有merchantId
this.initTwo()
} }
this.initCoupon() this.initCoupon()
}else{ } else {
this.login() this.login()
} }
}, },
// 一般页面用onUnload // 一般页面用onUnload
// tabbar页面用onHide // tabbar页面用onHide
onUnload() { onUnload() {
if(this.timer) { if (this.timer) {
clearTimeout(this.timer) clearTimeout(this.timer)
this.timer = null this.timer = null
} }
}, },
methods: { methods: {
getUserBrowse(){//---获取浏览记录 login() {
let queryUrl=this.$commonjs.getCurrentPageUrl() //---登录
let data={ let _this = this
openid:uni.getStorageSync('openid') ,//用户Id
userName:'',//用户昵称
pageType:4,//页面类型(0首页,1商户页,2产品页,3售票页,4付款页,5付款完成页,6行记页,7评论页,8咨询页,9劵中心页,11订单页,12订单详情页,13IC卡出行页,14电子门票页,15常用信息页,16其他页)
queryUrl,//页面全地址
merchantType:''//商户类型1景区,2酒店,3餐饮,4特产
}
this.$request('wechatUser/wxUser/saveUserBrowse',data).then((res)=>{
})
},
login(){//---登录
let _this=this
uni.getProvider({ uni.getProvider({
service: 'oauth', service: 'oauth',
success(proRes){ success(proRes) {
uni.login({ uni.login({
provider:proRes.provider[0], provider: proRes.provider[0],
success: function (res) { success: function (res) {
if(res.code){ if (res.code) {
let source='' let source = ''
if(proRes.provider[0]=='weixin'){ if (proRes.provider[0] == 'weixin') {
source=3 source = 3
}else if(proRes.provider[0]=='alipay'){ } else if (proRes.provider[0] == 'alipay') {
source=4 source = 4
} }
let data={ let data = {
code:res.code, code: res.code,
source,//微信小程序3,支付宝小程序4 source, //微信小程序3,支付宝小程序4
appid:uni.getStorageSync('appid')||'' appid: uni.getStorageSync('appid') || ''
} }
if(uni.getStorageSync('enterOptions').query){ if (uni.getStorageSync('enterOptions').query) {
data.companyId=uni.getStorageSync('enterOptions').query.companyId||'' data.companyId = uni.getStorageSync('enterOptions').query.companyId || ''
} }
_this.$request('wechat/wx/getUserInfoByCode',data).then(res => { _this.$request('wechat/wx/getUserInfoByCode', data).then(res => {
if(res.code=='00'){ if (res.code == '00') {
_this.openid=res.data.openid _this.openid = res.data.openid
uni.setStorageSync('openid',_this.openid) uni.setStorageSync('openid', _this.openid)
_this.getUserBrowse() if (_this.merchantId) {
if (_this.merchantId) { //大商家的有merchantId //大商家的有merchantId
_this.init() _this.init()
} else { //小商家没有merchantId } else {
_this.initTwo() //小商家没有merchantId
_this.initTwo()
} }
_this.initCoupon() _this.initCoupon()
//用于获取token等信息 //用于获取token等信息
let userId=res.data.userId||'' let userId = res.data.userId || ''
let openid=res.data.openid||'' let openid = res.data.openid || ''
let datas={openid,source,userId} let datas = { openid, source, userId }
_this.$request('wechatUser/login/findWxUserAndLogin',datas).then((res)=>{ _this
if(res.code=='00'){ .$request('wechatUser/login/findWxUserAndLogin', datas)
let token=res.data.token||'' .then(res => {
uni.setStorageSync('token',token) if (res.code == '00') {
let createUserId=res.data.personId||'' let token = res.data.token || ''
uni.setStorageSync('createUserId',createUserId) uni.setStorageSync('token', token)
let userId=res.data.userId||'' let createUserId = res.data.personId || ''
uni.setStorageSync('userId',userId) uni.setStorageSync('createUserId', createUserId)
}else{ let userId = res.data.userId || ''
uni.showToast({ uni.setStorageSync('userId', userId)
title:res.message, } else {
icon:'none' uni.showToast({
}) title: res.message,
} icon: 'none'
}).catch((err)=>{ })
uni.showToast({ }
title:'登录失败', })
icon:'none' .catch(err => {
}) uni.showToast({
_this.timer = setTimeout(() => { title: '登录失败',
_this.login() icon: 'none'
}, 2000) })
}) _this.timer = setTimeout(() => {
}else{ _this.login()
}, 2000)
})
} else {
uni.showToast({ uni.showToast({
title:res.message, title: res.message,
icon:'none' icon: 'none'
}) })
} }
}).catch((err)=>{
uni.showToast({
title:'登录失败',
icon:'none'
})
_this.timer = setTimeout(() => {
_this.login()
}, 2000)
}) })
.catch(err => {
uni.showToast({
title: '登录失败',
icon: 'none'
})
_this.timer = setTimeout(() => {
_this.login()
}, 2000)
})
} }
} }
}) })
} }
}) })
}, },
getUrlKey(name){//---获取url getUrlKey(name) {
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || '' //---获取url
return (
(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
)
}, },
clickNum(i,index,a) {//---输入数字 clickNum(i, index, a) {
//---输入数字
//不超过14位数 //不超过14位数
if(this.buyMoney.length>13){ if (this.buyMoney.length > 13) {
return return
} }
this.buyMoney += i this.buyMoney += i
this.leftList[index].child[a].background='#dddddd' this.leftList[index].child[a].background = '#dddddd'
setTimeout(()=>{ setTimeout(() => {
this.leftList[index].child[a].background='' this.leftList[index].child[a].background = ''
},200) }, 200)
clearTimeout(this.flag) clearTimeout(this.flag)
this.flag = setTimeout(()=>{ this.flag = setTimeout(() => {
this.initCoupon() this.initCoupon()
}, 1500) }, 1500)
}, },
clickEnter(){//---退格 clickEnter() {
//---退格
this.buyMoney = this.buyMoney.substr(0, this.buyMoney.length - 1) this.buyMoney = this.buyMoney.substr(0, this.buyMoney.length - 1)
this.spaceBackground='#dddddd' this.spaceBackground = '#dddddd'
setTimeout(()=>{ setTimeout(() => {
this.spaceBackground='' this.spaceBackground = ''
},200) }, 200)
clearTimeout(this.flag) clearTimeout(this.flag)
this.flag = setTimeout(()=>{ this.flag = setTimeout(() => {
this.initCoupon() this.initCoupon()
}, 1500) }, 1500)
}, },
couponChoose(data) { //---子组件券选择之后触发的事件 couponChoose(data) {
if(data){ //---子组件券选择之后触发的事件
if (data) {
this.chooseCouponObj = data this.chooseCouponObj = data
this.savedMoney=this.chooseCouponObj.savedMoney||0 this.savedMoney = this.chooseCouponObj.savedMoney || 0
}else{ } else {
this.chooseCouponObj = '' this.chooseCouponObj = ''
this.savedMoney=0 this.savedMoney = 0
} }
}, },
showCoupon() { //---展示券列表 showCoupon() {
this.$refs.orderCoupon.showCoupon() //---展示券列表
this.$refs.orderCoupon.showCoupon()
}, },
init() { //---初始化获取商家名称,大商家 init() {
let data = { //---初始化获取商家名称,大商家
'merchantId': this.merchantId, let data = {
'companyId': this.companyId, merchantId: this.merchantId,
} companyId: this.companyId
uni.showLoading({title: '加载中',mask:true}) }
this.$request('scenic/order/findCodePayInfo',data).then((res) => { uni.showLoading({ title: '加载中', mask: true })
uni.hideLoading() this.$request('scenic/order/findCodePayInfo', data)
if (res.code =='00') { .then(res => {
this.name = res.data.name uni.hideLoading()
} else { if (res.code == '00') {
uni.showToast({ this.name = res.data.name
title:res.message, } else {
icon:'none' uni.showToast({
}) title: res.message,
} icon: 'none'
}).catch((err)=>{ })
uni.hideLoading() }
}) })
.catch(err => {
uni.hideLoading()
})
}, },
initTwo() { //---初始化获取商家名称,没有merchantId的小商家 initTwo() {
let data = { //---初始化获取商家名称,没有merchantId的小商家
'id': this.companyId, let data = {
} id: this.companyId
uni.showLoading({title: '加载中',mask:true}) }
this.$request('user/company/detail', data).then((res) => { uni.showLoading({ title: '加载中', mask: true })
uni.hideLoading() this.$request('user/company/detail', data)
if (res.code=='00'){ .then(res => {
this.companyAttribute=res.data.companyVo.companyAttribute uni.hideLoading()
this.paydJumpUrl=res.data.paydJumpUrl if (res.code == '00') {
if(this.companyAttribute==5){//出租车显示联系人姓名,其他显示公司名称 this.companyAttribute = res.data.companyVo.companyAttribute
this.name = res.data.companyVo.contactName this.paydJumpUrl = res.data.paydJumpUrl
}else{ if (this.companyAttribute == 5) {
this.name = res.data.companyVo.companyName //出租车显示联系人姓名,其他显示公司名称
} this.name = res.data.companyVo.contactName
} else { } else {
uni.showToast({ this.name = res.data.companyVo.companyName
title:res.message, }
icon:'none' } else {
}) uni.showToast({
} title: res.message,
}).catch((err)=>{ icon: 'none'
uni.hideLoading() })
}) }
})
.catch(err => {
uni.hideLoading()
})
}, },
initCoupon() { //---加载优惠券 initCoupon() {
let savedMoneyList = [] //---加载优惠券
this.chooseCouponObj = '' let savedMoneyList = []
this.ableConpon = '' this.chooseCouponObj = ''
let data = { this.ableConpon = ''
money:parseFloat(this.buyMoney)||0, //订单总价,不算券,和现金红包 let data = {
merchantId:this.merchantId, //商户Id money: parseFloat(this.buyMoney) || 0, //订单总价,不算券,和现金红包
companyId:this.companyId,//公司Id merchantId: this.merchantId, //商户Id
orderSource:this.orderSource,//订单来源 8扫码支付 companyId: this.companyId, //公司Id
openid:this.openid orderSource: this.orderSource, //订单来源 8扫码支付
} openid: this.openid
this.$request('wechatUser/myPage/usableCouponList',data).then((res) =>{ }
if (res.code == '00') { this.$request('wechatUser/myPage/usableCouponList', data).then(res => {
this.couponData = res.data if (res.code == '00') {
let masterSlaveCouponList=res.data.masterSlaveCouponList this.couponData = res.data
if (masterSlaveCouponList&&masterSlaveCouponList.length>0) { let masterSlaveCouponList = res.data.masterSlaveCouponList
masterSlaveCouponList.forEach((item) => { //获取最优券 if (masterSlaveCouponList && masterSlaveCouponList.length > 0) {
savedMoneyList.push(item.savedMoney) masterSlaveCouponList.forEach(item => {
}) //获取最优券
let maxMoney = Math.max.apply(null, savedMoneyList) savedMoneyList.push(item.savedMoney)
let arr=masterSlaveCouponList.filter((item)=>{//找到最大值的数组 })
return item.savedMoney==maxMoney let maxMoney = Math.max.apply(null, savedMoneyList)
}) let arr = masterSlaveCouponList.filter(item => {
if(arr.length==1){ //找到最大值的数组
this.chooseCouponObj=arr[0] return item.savedMoney == maxMoney
}else{ })
if (arr.length == 1) {
this.chooseCouponObj = arr[0]
} else {
//如果数组有多个时 //如果数组有多个时
let index=arr.findIndex((item)=>{//如果有多个,找到是否有平台券,平台劵优先 let index = arr.findIndex(item => {
return item.createSource==1 //如果有多个,找到是否有平台券,平台劵优先
}) return item.createSource == 1
if(index>-1){ })
this.chooseCouponObj=arr[index] if (index > -1) {
}else{ this.chooseCouponObj = arr[index]
this.chooseCouponObj=arr[0] } else {
} this.chooseCouponObj = arr[0]
} }
this.savedMoney=this.chooseCouponObj.savedMoney }
} else { this.savedMoney = this.chooseCouponObj.savedMoney
if (res.data.unusableCouponList.length > 0) { } else {
res.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券 if (res.data.unusableCouponList.length > 0) {
if (item.isProduct == 1) { res.data.unusableCouponList.forEach((item, i) => {
this.ableConpon = item //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
} if (item.isProduct == 1) {
}) this.ableConpon = item
} }
} })
} }
}) }
}
})
}, },
clickPay(){//---点击立即支付,获取支付需要的参数 clickPay() {
//---点击立即支付,获取支付需要的参数
if (!parseFloat(this.buyMoney)) { if (!parseFloat(this.buyMoney)) {
uni.showToast({ uni.showToast({
title:'请输入正确金额', title: '请输入正确金额',
icon:'none' icon: 'none'
}) })
return return
} }
let couponList = [] let couponList = []
if (this.chooseCouponObj != '') { if (this.chooseCouponObj != '') {
if(this.chooseCouponObj.slaveList.length>0){//有从卷取值从卷,没有从卷取值主劵 if (this.chooseCouponObj.slaveList.length > 0) {
couponList=[//券列表 //有从卷取值从卷,没有从卷取值主劵
{ couponList = [
couponId:this.chooseCouponObj.slaveCouponId,//券id //券列表
isMerchant:this.chooseCouponObj.slaveCreateSource,//是否是商户的券 {
myCouponId:this.chooseCouponObj.slaveId,//领取人编号 couponId: this.chooseCouponObj.slaveCouponId, //券id
couponType:this.chooseCouponObj.couponType,//券类型 isMerchant: this.chooseCouponObj.slaveCreateSource, //是否是商户的券
couponPrice:this.chooseCouponObj.savedMoney,//券价格 myCouponId: this.chooseCouponObj.slaveId, //领取人编号
couponCompanyId:this.chooseCouponObj.companyId,//公司Id couponType: this.chooseCouponObj.couponType, //券类型
} couponPrice: this.chooseCouponObj.savedMoney, //券价格
] couponCompanyId: this.chooseCouponObj.companyId //公司Id
}else{ }
couponList=[ ]
{ } else {
couponId:this.chooseCouponObj.couponId,//券id couponList = [
isMerchant:this.chooseCouponObj.createSource,//是否是商户的券 {
myCouponId:this.chooseCouponObj.id,//领取人编号 couponId: this.chooseCouponObj.couponId, //券id
couponType:this.chooseCouponObj.couponType,//券类型 isMerchant: this.chooseCouponObj.createSource, //是否是商户的券
couponPrice:this.chooseCouponObj.savedMoney,//券价格 myCouponId: this.chooseCouponObj.id, //领取人编号
couponCompanyId:this.chooseCouponObj.companyId,//公司Id couponType: this.chooseCouponObj.couponType, //券类型
} couponPrice: this.chooseCouponObj.savedMoney, //券价格
] couponCompanyId: this.chooseCouponObj.companyId //公司Id
} }
]
}
} }
let data = { let data = {
companyId: this.companyId, companyId: this.companyId,
merchantId: this.merchantId, merchantId: this.merchantId,
userId:this.openid, userId: this.openid,
orderMoney: parseFloat(this.buyMoney), orderMoney: parseFloat(this.buyMoney),
payType: this.payType, //支付类型, payType: this.payType, //支付类型,
orderSource:this.orderSource,//订单来源 8扫码支付 orderSource: this.orderSource, //订单来源 8扫码支付
couponList,//券列表 couponList, //券列表
extendInfo:this.extendInfo,//额外信息 extendInfo: this.extendInfo ,//额外信息
remark:this.remark,//备注信息
} }
this.payBackground='#cccccc' this.payBackground = '#cccccc'
//重新加载优惠券 //重新加载优惠券
this.initCoupon() this.initCoupon()
this.$request('orderc/order/codePay', data).then((res) => { this.$request('orderc/order/codePay', data)
setTimeout(() => { .then(res => {
this.payBackground='#1dce2e' setTimeout(() => {
},1000) this.payBackground = '#3688FF'
if(res.code=='00') { }, 1000)
if (res.data.errorMessage) { if (res.code == '00') {
if (res.data.errorMessage) {
uni.showToast({
title: res.data.errorMessage,
icon: 'none'
})
return
}
this.orderId = res.data.id
//微信入参
this.signType = res.data.signType
this.paySign = res.data.sign
this.timeStamp = res.data.timestamp
this.nonceStr = res.data.noncestr
this.package = res.data.package
//支付宝入参
this.orderInfo = res.data.payInfo || ''
this.goPay()
} else {
uni.showToast({ uni.showToast({
title:res.data.errorMessage, title: res.message,
icon:'none' icon: 'none'
}) })
return
} }
this.orderId=res.data.id })
//微信入参 .catch(err => {
this.signType = res.data.signType this.payBackground = '#3688FF'
this.paySign = res.data.sign })
this.timeStamp = res.data.timestamp
this.nonceStr = res.data.noncestr
this.package = res.data.package
//支付宝入参
this.orderInfo = res.data.payInfo || ''
this.goPay()
} else {
uni.showToast({
title:res.message,
icon:'none'
})
}
}).catch((err) => {
this.payBackground='#1dce2e'
})
}, },
goPay(){//---去支付 goPay() {
let _this=this //---去支付
let _this = this
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', provider: 'wxpay',
timeStamp:this.timeStamp, timeStamp: this.timeStamp,
nonceStr:this.nonceStr, nonceStr: this.nonceStr,
package:this.package, package: this.package,
signType:this.signType, signType: this.signType,
paySign:this.paySign, paySign: this.paySign,
success: function (res) { success: function (res) {
if(_this.companyAttribute==5){//出租车跳转分销组合票页面 if (_this.companyAttribute == 5) {
//出租车跳转分销组合票页面
uni.navigateTo({ uni.navigateTo({
url:_this.paydJumpUrl url: _this.paydJumpUrl
}) })
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url:'/pages/payment/paySuccess/paySuccess?orderId='+_this.orderId url: '/pages/payment/paySuccess/paySuccess?orderId=' + _this.orderId
}) })
} }
}, },
fail: function (err) { fail: function (err) {
uni.showToast({ uni.showToast({
title:err.errMsg, title: err.errMsg,
icon:'none' icon: 'none'
}) })
} }
}) })
//#endif //#endif
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
uni.requestPayment({ uni.requestPayment({
provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay
orderInfo: this.orderInfo, // 支付宝订单号 orderInfo: this.orderInfo, // 支付宝订单号
success: function (res) { success: function (res) {
if(_this.companyAttribute==5){//出租车跳转分销组合票页面 if (_this.companyAttribute == 5) {
//出租车跳转分销组合票页面
uni.navigateTo({ uni.navigateTo({
url:_this.paydJumpUrl url: _this.paydJumpUrl
}) })
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url:'/pages/payment/paySuccess/paySuccess?orderId='+_this.orderId url: '/pages/payment/paySuccess/paySuccess?orderId=' + _this.orderId
}) })
} }
}, },
fail: function (err) { fail: function (err) {
uni.showToast({ uni.showToast({
title:err.errMsg, title: err.errMsg,
icon:'none' icon: 'none'
}) })
} }
}) })
...@@ -555,73 +590,206 @@ export default { ...@@ -555,73 +590,206 @@ export default {
} }
}, },
watch: { watch: {
buyMoney(val, oldVal) { buyMoney(val, oldVal) {
if (val == '.' && oldVal == '') { //首位数是小数点自动加上0 if (val == '.' && oldVal == '') {
this.buyMoney = 0 + '.' //首位数是小数点自动加上0
} this.buyMoney = 0 + '.'
if (val == '0' && oldVal == '') { //首位数是0自动加上小数点 }
this.buyMoney = 0 + '.' if (val == '0' && oldVal == '') {
} //首位数是0自动加上小数点
if (val.length == 2) { //防止回退之后出现01,02等状况 this.buyMoney = 0 + '.'
if (val.substr(0, 1) == 0 && val.substr(1, 2) != '.') { }
this.buyMoney = val.substr(1, 2) if (val.length == 2) {
} //防止回退之后出现01,02等状况
if (val.substr(0, 1) == 0 && val.substr(1, 2) != '.') {
this.buyMoney = val.substr(1, 2)
}
}
if (isNaN(val) && val != '.') {
//出现非数字,输入无效
this.buyMoney = oldVal
}
var x = String(this.buyMoney).indexOf('.') + 1 //小数点的位置
var y = String(this.buyMoney).length - x //小数的位数
if (y > 2 && x > 0) {
this.buyMoney = oldVal
} }
if (isNaN(val) && val != '.') { //出现非数字,输入无效
this.buyMoney = oldVal
}
var x = String(this.buyMoney).indexOf('.') + 1 //小数点的位置
var y = String(this.buyMoney).length - x //小数的位数
if (y > 2 && x > 0) {
this.buyMoney = oldVal
}
if (parseFloat(this.buyMoney)) { if (parseFloat(this.buyMoney)) {
this.payBackground='#1dce2e' this.payBackground = '#3688FF'
} else { } else {
this.payBackground='#cccccc' this.payBackground = '#cccccc'
} }
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.bigBox{background:#f5f5f5;height: 100%;} .bigBox {
/*上部分*/ background: #f5f5f5;
.top{background: #FFFFFF;} height: 100%;
.topName{font-size:30rpx;font-weight: bold;padding: 50rpx 24rpx 0 24rpx;display: flex;align-items: center;justify-content: center;} }
.topIcon{display:inline-flex;margin-right:10rpx;width:50rpx;height:50rpx;border-radius:50%;background:#FF8B57;align-items:center;justify-content:center;} /*上部分*/
.icon-tubiaolunkuo-{font-size:36rpx;color: #FFFFFF;font-weight: 400;} .top {
.topMoney{padding:80rpx 24rpx 24rpx 24rpx;display: flex;justify-content:space-between;align-items: center;} background: #ffffff;
.moneyText{color: #FF3C00;font-size:32rpx;font-weight: bold;} border-bottom: 1px solid #ececec;
.moneyNumber text:nth-child(2){font-size:62rpx;font-weight: bold;position: relative;left: -6rpx;} }
.moneyNumber text:last-child{animation: dis 1.5s infinite;transition: 1s;width: 1px;height:56rpx;display: inline-block;background: #333333;position: relative;top:8rpx;} .topName {
.topCoupon{display: flex;height: 90rpx;border-top:1px solid $divider;align-items:center;padding:0 24rpx;justify-content: space-between;} font-size: 30rpx;
.couponLeft{font-size:24rpx;} font-weight: bold;
.couponLeft text:first-child{margin-right:10rpx;display: inline-block;width:30rpx;height:30rpx;background: #f9690e;color: #FFFFFF;text-align: center;line-height:28rpx;border-radius:4rpx;} padding: 50rpx 24rpx 0 24rpx;
.couponRight{position:relative;left:8rpx;} display: flex;
.couponRight text:first-child{font-size:32rpx;color:#f9690e;} align-items: center;
.couponRight text:nth-child(2){font-size: 32rpx;color: #F9690E;font-weight:bold;} justify-content: center;
/*中间部分*/ }
.middle{padding:50rpx 24rpx 0 24rpx;font-size: 24rpx;color: #999999;line-height: 40rpx;} .topIcon {
/*下部分*/ display: inline-flex;
.bottom{position:absolute;bottom:0;height:40%;background: #FFFFFF;width:100%;display: flex;border-top:1px solid #dddddd;font-size:50rpx;} margin-right: 10rpx;
.botLeft{width:75%;} width: 50rpx;
.botLeft view{height:25%;display: flex;border-bottom:1px solid #dddddd;} height: 50rpx;
.botLeft view:last-child{border:none;} border-radius: 50%;
.botLeft view:last-child text:first-child{width:66.7%;} background: #ff8b57;
.botLeft view:last-child text:last-child{width: 33.3%;} align-items: center;
.botLeft view text{flex:1;height:100%;display:inline-flex;align-items: center;justify-content: center;border-right:1px solid #dddddd;} justify-content: center;
.botLeft view:last-child text{flex:initial;} }
.botRight{width:25%;} .icon-tubiaolunkuo- {
.rightOne{height: 25%;display: flex;align-items:center;justify-content: center;border-bottom:1px solid #dddddd;} font-size: 36rpx;
.rightTwo{height: 75%;border:none;color: #FFFFFF;display: flex;flex-direction:column;align-items:center;justify-content: center;} color: #ffffff;
@keyframes dis{ font-weight: 400;
from{ }
opacity: 0; .topMoney {
} padding: 80rpx 24rpx 24rpx 24rpx;
to{ }
opacity: 1; .moneyText {
} color: #ff3c00;
font-size: 32rpx;
font-weight: bold;
}
.moneyNumber{
margin-top: 30rpx;
}
.moneyNumber text:nth-child(2) {
font-size: 62rpx;
font-weight: bold;
position: relative;
left: -6rpx;
}
.moneyNumber text:last-child {
animation: dis 1.5s infinite;
transition: 1s;
width: 1px;
height: 56rpx;
display: inline-block;
background: #333333;
position: relative;
top: 8rpx;
}
.topCoupon {
display: flex;
height: 90rpx;
border-top: 1px solid $divider;
align-items: center;
padding: 0 24rpx;
justify-content: space-between;
}
.couponLeft {
font-size: 24rpx;
}
.couponLeft text:first-child {
margin-right: 10rpx;
display: inline-block;
width: 30rpx;
height: 30rpx;
background: #f9690e;
color: #ffffff;
text-align: center;
line-height: 28rpx;
border-radius: 4rpx;
}
.couponRight {
position: relative;
left: 8rpx;
}
.couponRight text:first-child {
font-size: 32rpx;
color: #f9690e;
}
.couponRight text:nth-child(2) {
font-size: 32rpx;
color: #f9690e;
font-weight: bold;
}
/*中间部分*/
.middle {
padding: 30rpx 24rpx 50rpx 24rpx;
color: #999999;
line-height: 40rpx;
background: #ffffff;
}
/*下部分*/
.bottom {
position: absolute;
bottom: 0;
height: 40%;
background: #ffffff;
width: 100%;
display: flex;
border-top: 1px solid #dddddd;
font-size: 50rpx;
}
.botLeft {
width: 75%;
}
.botLeft view {
height: 25%;
display: flex;
border-bottom: 1px solid #dddddd;
}
.botLeft view:last-child {
border: none;
}
.botLeft view:last-child text:first-child {
width: 66.7%;
}
.botLeft view:last-child text:last-child {
width: 33.3%;
}
.botLeft view text {
flex: 1;
height: 100%;
display: inline-flex;
align-items: center;
justify-content: center;
border-right: 1px solid #dddddd;
}
.botLeft view:last-child text {
flex: initial;
}
.botRight {
width: 25%;
}
.rightOne {
height: 25%;
display: flex;
align-items: center;
justify-content: center;
border-bottom: 1px solid #dddddd;
}
.rightTwo {
height: 75%;
border: none;
color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
@keyframes dis {
from {
opacity: 0;
}
to {
opacity: 1;
} }
}
</style> </style>
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