Compare commits

..

2 Commits

Author SHA1 Message Date
唐明明
d8d5766c86 merge 2021-09-18 15:19:56 +08:00
唐明明
7ebb45e5ab 使用优惠券购买权证流程调整新增支付成功提示页面 2021-09-18 15:17:31 +08:00
9 changed files with 27922 additions and 27368 deletions

View File

@@ -534,6 +534,13 @@
"type": "transparent" "type": "transparent"
} }
} }
},{
"path" : "pages/pay/results",
"name" : "payResults",
"style": {
"navigationBarTitleText": "支付结果",
"backgroundColor": "#FFFFFF"
}
} }
], ],
"tabBar": { "tabBar": {

View File

@@ -152,7 +152,7 @@
<image @click="serveClose" class="close" src="../../static/icons/goods_close.png" mode=""></image> <image @click="serveClose" class="close" src="../../static/icons/goods_close.png" mode=""></image>
</view> </view>
<view class="serve-cont"> <view class="serve-cont">
<view class="serve-label" v-for="(item, index) in goodsObj.services"> <view class="serve-label" v-for="(item, index) in goodsObj.services" :key="index">
<view class="serve-label-name"> <view class="serve-label-name">
{{item.name}} {{item.name}}
</view> </view>
@@ -184,9 +184,7 @@
}; };
}, },
created() { created() {
goods(this.$Route.query.id || 16).then(res=>{ goods(this.$Route.query.id).then(res=>{
console.log('啦啦啦')
console.log(res.coupons)
this.loding = false this.loding = false
this.goodsObj = res this.goodsObj = res
this.identity = res.identity.id || '' this.identity = res.identity.id || ''
@@ -241,19 +239,25 @@
}, },
// 领取优惠券 // 领取优惠券
drawCoupons(id, index){ drawCoupons(id){
let token = this.$store.getters.getToken
if(token == ''){
let userLogin = new userAuth()
userLogin.Login()
return
}
managesCoupons(id).then(res=>{ managesCoupons(id).then(res=>{
uni.showToast({ uni.showToast({
title: '领取成功', title: '领取成功',
type: 'primary', type: 'primary',
duration: 3000 duration: 3000
}) })
}).catch(err =>{ }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, icon : 'none',
icon : 'none' title: err.message
}) })
}) })
}, },
// 选择优惠券-显示 // 选择优惠券-显示

View File

@@ -23,9 +23,9 @@
<block v-if="coupons.length > 0"> <block v-if="coupons.length > 0">
<view class="item"> <view class="item">
<label>使用优惠券</label> <label>使用优惠券</label>
<picker> <picker mode="selector" :range="coupons" range-key="title" :value="couponIndex" @change="couponsChange">
<view class="picker-text nowrap"> <view class="picker-text nowrap">
优惠券 {{couponIndex == 0 ? '选择优惠券' : coupons[couponIndex].title}}
<uni-icons type="arrowright" color="#ddd"></uni-icons> <uni-icons type="arrowright" color="#ddd"></uni-icons>
</view> </view>
</picker> </picker>
@@ -35,6 +35,10 @@
<view class="price nowrap">-{{couponPrice}}</view> <view class="price nowrap">-{{couponPrice}}</view>
</view> </view>
</block> </block>
<view class="item">
<label>实际支付金额</label>
<view class="price nowrap">{{total}}</view>
</view>
</view> </view>
<!-- 支付方式 --> <!-- 支付方式 -->
<radio-group class="pay-group" @change="payType"> <radio-group class="pay-group" @change="payType">
@@ -71,6 +75,8 @@
amount : 0, amount : 0,
total : 0, total : 0,
coupons : [], coupons : [],
couponIndex : 0,
couponId : '',
account : {}, account : {},
payValue : 'eb', payValue : 'eb',
} }
@@ -78,16 +84,15 @@
created(){ created(){
buy({ buy({
goods_sku_id: this.$Route.query.skuId, goods_sku_id: this.$Route.query.skuId,
qty : this.$Route.query.qty, qty : this.qty,
type : 1 type : 1
}, 'GET').then(res=>{ }, 'GET').then(res=>{
this.loding = true this.loding = true
this.qty = this.$Route.query.qty,
this.payValue = this.$Route.query.type === 1 ? 'wx' : 'eb' this.payValue = this.$Route.query.type === 1 ? 'wx' : 'eb'
this.detail = res.detail this.detail = res.detail
this.couponPrice = res.coupon_price this.couponPrice = res.coupon_price.toFixed(2)
this.amount = res.amount this.amount = res.amount.toFixed(2)
this.total = res.total this.total = res.total.toFixed(2)
this.coupons = res.coupons this.coupons = res.coupons
this.account = res.account this.account = res.account
}).catch(err =>{ }).catch(err =>{
@@ -98,6 +103,35 @@
}) })
}, },
methods: { methods: {
// 获取可用优惠券
getCoupons(){
buy({
goods_sku_id : this.$Route.query.skuId,
qty : this.qty,
type : 1,
coupon_grant_id : this.couponId
}, 'GET').then(res=>{
this.couponPrice = res.coupon_price.toFixed(2)
this.amount = res.amount.toFixed(2)
this.total = res.total.toFixed(2)
this.coupons = [{
title : '不使用',
coupon_grant_id : ''
}, ...res.coupons]
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 选择优惠券
couponsChange(e){
this.couponIndex = e.detail.value
this.couponId = this.coupons[e.detail.value].coupon_grant_id
this.getCoupons()
},
// 选择支付类型
payType(e){ payType(e){
this.payValue = e.detail.value this.payValue = e.detail.value
}, },
@@ -105,17 +139,20 @@
//数量变化 //数量变化
numberChange(e){ numberChange(e){
this.qty = e this.qty = e
this.amount = this.detail[0].items[0].price * e this.getCoupons()
}, },
// 提交订单 // 提交订单
buyOrder(){ buyOrder(){
buy({ buy({
goods_sku_id: this.$Route.query.skuId || 23, goods_sku_id : this.$Route.query.skuId,
qty : this.qty, qty : this.qty,
type : this.payValue == 'eb' ? 1 : 2, coupon_grant_id : this.couponId,
remark : 'app订单' type : 1,
remark : 'app订单易货产品',
channel : 'app'
}, 'POST').then(res=>{ }, 'POST').then(res=>{
console.log(res)
switch (this.payValue){ switch (this.payValue){
case 'eb': case 'eb':
this.ebPay(res.order_no) this.ebPay(res.order_no)
@@ -131,6 +168,7 @@
break; break;
} }
}).catch(err =>{ }).catch(err =>{
console.log(err)
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon : 'none'
@@ -147,14 +185,20 @@
// 易币支付 // 易币支付
ebPay(orderNo){ ebPay(orderNo){
eb(orderNo).then(res => { eb(orderNo).then(res => {
uni.showModal({ this.$Router.replace({
title: '提示', name : 'payResults',
content: '支付成功,后续优化支付成功后直接转跳我的权证' params : {
index: 1,
price: this.total,
type : 'eb',
total: '可在我的资产下我的权证中查看购买的数字权证'
}
}) })
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showModal({
title: err.message, title : '支付提示',
icon : 'none' content : err.message,
showCancel : false,
}) })
}) })
} }

76
pages/pay/results.vue Normal file
View File

@@ -0,0 +1,76 @@
<template>
<view class="total vertical">
<uni-icons type="checkbox-filled" size="60" color="#e93340"></uni-icons>
<view class="title">支付成功</view>
<view class="price">支付金额<text>{{type}}10.00</text></view>
<view class="text">{{total}}</view>
<button class="btn" type="default" @click="onBack">确定</button>
</view>
</template>
<script>
export default {
data() {
return {
index: 1, // 返回层级
price: 0, // 支付金额
type : '¥', // 支付币种
total: '' // 支付提示语
};
},
created() {
this.index = this.$Route.query.index
this.price = this.$Route.query.price
this.type = this.$Route.query.type === 'eb' ? 'EB': '¥'
this.total = this.$Route.query.total
},
methods:{
onBack(){
this.$Router.back(this.index)
}
}
}
</script>
<style lang="scss" scoped>
.total{
text-align: center;
height: 100vh;
width: 100vw;
padding-left: 10vw;
padding-right: 10vw;
padding-bottom: 20vh;
box-sizing: border-box;
.title{
font-weight: bold;
font-size: $title-size + 10;
padding: 20rpx 0
}
.price{
font-size: $title-size-lg;
color: $text-gray;
text{
color: $text-price;
padding-left: 10rpx;
}
}
.text{
font-size: $title-size-lg;
color: $text-gray;
padding-top: $padding;
}
.btn{
height: 90rpx;
line-height: 90rpx;
border-radius: 0;
background: $text-price;
font-size: $title-size;
color: white;
font-weight: bold;
margin-top: 10vh;
&::after{
border: none;
}
}
}
</style>

View File

@@ -64,6 +64,7 @@
page:this.page page:this.page
} }
mallWarrants(data).then(res=>{ mallWarrants(data).then(res=>{
console.log(res)
this.lists = this.lists.concat(res.data) this.lists = this.lists.concat(res.data)
this.total = res.total this.total = res.total
}).catch(err=>{ }).catch(err=>{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__CD19AAD","name":"易品新境","version":{"name":"1.0.0","code":"100"},"description":"易品新境为商家提供营销引流工具","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#f5f5f5"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"oauth":{"univerify":{},"weixin":{"appid":"wx222fbe58feee7819","appsecret":"3d24525a636d7573a8fae885097d5cf7","UniversalLinks":""}},"payment":{"weixin":{"__platform__":["android"],"appid":"wx222fbe58feee7819","UniversalLinks":""}},"share":{"weixin":{"appid":"wx222fbe58feee7819","UniversalLinks":""}},"maps":{},"ad":{},"geolocation":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"arguments":"{\"name\":\"\",\"path\":\"\",\"query\":\"\",\"id\":0}","allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.1.18","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#bababa","selectedColor":"#e93340","backgroundColor":"#FFFFFF","borderStyle":"rgba(255,255,255,0.4)","list":[{"pagePath":"pages/equity/index","text":"通证权易","iconPath":"static/tabBar/tabBar_icon_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png"},{"pagePath":"pages/market/index","text":"转让市场","iconPath":"static/tabBar/tabBar_icon_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png"},{"pagePath":"pages/store/index","text":"企业工具","iconPath":"static/tabBar/tabBar_icon_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png"},{"pagePath":"pages/property/index","text":"我的资产","iconPath":"static/tabBar/tabBar_icon_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}} {"@platforms":["android","iPhone","iPad"],"id":"__UNI__CD19AAD","name":"易品新境","version":{"name":"1.0.0","code":"100"},"description":"易品新境为商家提供营销引流工具","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#f5f5f5"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"oauth":{"univerify":{},"weixin":{"appid":"wx222fbe58feee7819","appsecret":"3d24525a636d7573a8fae885097d5cf7","UniversalLinks":""}},"payment":{"weixin":{"__platform__":["android"],"appid":"wx222fbe58feee7819","UniversalLinks":""}},"share":{"weixin":{"appid":"wx222fbe58feee7819","UniversalLinks":""}},"maps":{},"ad":{},"geolocation":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"arguments":"{\"name\":\"\",\"path\":\"\",\"query\":\"\",\"id\":0}","allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.2.3","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#bababa","selectedColor":"#e93340","backgroundColor":"#FFFFFF","borderStyle":"rgba(255,255,255,0.4)","list":[{"pagePath":"pages/equity/index","text":"通证权易","iconPath":"static/tabBar/tabBar_icon_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png"},{"pagePath":"pages/market/index","text":"转让市场","iconPath":"static/tabBar/tabBar_icon_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png"},{"pagePath":"pages/store/index","text":"企业工具","iconPath":"static/tabBar/tabBar_icon_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png"},{"pagePath":"pages/property/index","text":"我的资产","iconPath":"static/tabBar/tabBar_icon_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}}