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"
}
}
},{
"path" : "pages/pay/results",
"name" : "payResults",
"style": {
"navigationBarTitleText": "支付结果",
"backgroundColor": "#FFFFFF"
}
}
],
"tabBar": {

View File

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

View File

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