Commit 130a432f authored by 黄奎's avatar 黄奎

成功页面新

parent 9c0e930c
......@@ -4,7 +4,7 @@
<u-col span="6" v-for="(cx, ci) in g" :key="ci">
<view class="good" @click="clickHandler(cx)">
<view class="good-img">
<image mode="aspectFill" :src="cx.cover_pic" style="width: 100%; height: 100%;">
<image mode="scaleToFill" :src="cx.cover_pic" style="width: 100%; height: 100%;">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/plugins-out.png" v-if="cx.totalStock==0&&setting.is_show_korea&&setting.is_show_korea==0"
style="width: 100%; height: 100%;position: absolute;left:0;top:0;background: #000;opacity: 0.6;" />
</image>
......
<template>
<view>
<u-popup
close-icon-color="red"
v-model="show"
mode="center"
:mask-close-able="false"
length="auto"
:closeable="true"
close-icon="close"
:border-radius="20"
:z-index="9999"
>
<u-popup close-icon-color="red" v-model="show" mode="center" :mask-close-able="false" length="auto"
:closeable="true" close-icon="close" :border-radius="20" :z-index="9999">
<view style="background:#fff;width:550rpx;padding:40rpx;border-radius:20px">
<u-icon @click="closePay" name="close" style="float:right;font-size:40rpx"></u-icon>
<p style="text-align: center;font-size: 26rpx;">支付方式</p>
<p style="font-size: 36rpx;font-weight: 700;text-align: center;margin:30px 0">支付金额{{ payInfo.total_price }}</p>
<p style="font-size: 36rpx;font-weight: 700;text-align: center;margin:30px 0">
支付金额{{ payInfo.total_price }}</p>
<view>
<view v-for="(item,index) in payList" @click="payType=item.Id" style="display: flex;justify-content: space-between;">
<view v-for="(item,index) in payList" @click="payType=item.Id"
style="display: flex;justify-content: space-between;">
<p v-if="item.Name=='微信'||(item.Name=='支付宝'&&isAlipay==1)">
<img style="width:50rpx;height:50rpx;margin-right:10px" :src="item.src" alt="" />
<span style="position:relative;top:-7px">{{item.Name}}</span>
</p>
<u-icon v-if="isAlipay==1" :name="payType==item.Id?'checked':'circle'"
:style="{'color':payType==item.Id?'red':''}"></u-icon>
:style="{'color':payType==item.Id?'red':''}"></u-icon>
</view>
</view>
<view style="margin-top:30px">
<u-button @click="Pay" type="error" shape="circle" :loading="loading">支付</u-button>
</view>
......@@ -35,112 +28,131 @@
</template>
<script>
export default {
props: ['payInfo','isAlipay'],
data() {
return {
loading:false,
show: true,
orderInfo: {},
payType:'wx_lite',
payList:[
{Name:'微信',Id:'wx_lite',src:'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/wx.png'},
{Name:'支付宝',Id:'alipay_qr',src:'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/zhifubao.png'},
]
};
},
created() {
console.log(wx)
},
wacth:{
payInfo: {
handler: function (val, oldval) {
},
deep: true,
}
},
methods: {
closePay() {
this.$emit('closePay');
},
Pay() {
let msg = {
'pay_channel':this.payType,//网页打开支付宝支付:alipay_wap 支付宝正扫:alipay_qr 支付宝app:alipay 微信小程序:wx_lite 微信公众号:wx_pub
'open_id':this.payType=='wx_lite'?this.payInfo.OpenId:'',
'hb_fq_num':'',
'orderId':this.payInfo.OrderId,
export default {
props: ['payInfo', 'isAlipay', 'StuId', 'TeacherIds'],
data() {
return {
u: {},
loading: false,
show: true,
orderInfo: {},
payType: 'wx_lite',
payList: [{
Name: '微信',
Id: 'wx_lite',
src: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/wx.png'
},
{
Name: '支付宝',
Id: 'alipay_qr',
src: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/zhifubao.png'
},
]
};
this.loading = true
uni.showLoading({
title:'正在调起支付'
})
this.request2(
{
url: '/api/Adapay/GetAdapayInfo',
data: msg
},
res => {
this.loading = false
uni.hideLoading()
if(res.data!=''){
if(this.payType!='wx_lite'){
this.aliPay(res.data)
}else{
this.wxPay(JSON.parse(res.data))
}
}else{
uni.showToast({
title:"调起支付失败,请重试",
icon:'error'
})
}
// uni.hideNavigationBarLoading();
}
);
},
// 支付宝支付
aliPay(url) {
window.location.href=url
created() {
console.log(wx)
this.u = uni.getStorageSync('mall_UserInfo')
},
// 微信支付
wxPay(payData) {
let that = this
uni.showLoading({
title:'支付中...'
})
wx.requestPayment(
{
"timeStamp": payData.timeStamp, //时间戳,自1970年以来的秒数
"nonceStr": payData.nonceStr, //随机串
"package": payData.package,
"signType": payData.signType, //微信签名方式:
"paySign": payData.paySign, //微信签名
'success':function(res){
uni.hideLoading()
uni.navigateTo({
url: '/pages/order-submit/pay-success?payInfo='+JSON.stringify(that.payInfo)
});
// uni.showToast({
// title:'支付成功'
// })
},
'fail':function(res){
uni.hideLoading()
uni.navigateTo({
url: '/pages/order/index/index?status=1'
});
wacth: {
payInfo: {
handler: function(val, oldval) {
},
'complete':function(res){
// uni.showToast({
// title:res.errMsg
// })
}
})
deep: true,
}
},
}
};
methods: {
closePay() {
this.$emit('closePay');
},
Pay() {
let msg = {
'pay_channel': this
.payType, //网页打开支付宝支付:alipay_wap 支付宝正扫:alipay_qr 支付宝app:alipay 微信小程序:wx_lite 微信公众号:wx_pub
'open_id': this.payType == 'wx_lite' ? this.payInfo.OpenId : '',
'hb_fq_num': '',
'orderId': this.payInfo.OrderId,
};
this.loading = true
uni.showLoading({
title: '正在调起支付'
})
this.request2({
url: '/api/Adapay/GetAdapayInfo',
data: msg
},
res => {
this.loading = false
uni.hideLoading()
if (res.data != '') {
if (this.payType != 'wx_lite') {
this.aliPay(res.data)
} else {
this.wxPay(JSON.parse(res.data))
}
} else {
uni.showToast({
title: "调起支付失败,请重试",
icon: 'error'
})
}
// uni.hideNavigationBarLoading();
}
);
},
// 支付宝支付
aliPay(url) {
window.location.href = url
},
// 微信支付
wxPay(payData) {
let that = this
uni.showLoading({
title: '支付中...'
})
wx.requestPayment({
"timeStamp": payData.timeStamp, //时间戳,自1970年以来的秒数
"nonceStr": payData.nonceStr, //随机串
"package": payData.package,
"signType": payData.signType, //微信签名方式:
"paySign": payData.paySign, //微信签名
'success': function(res) {
uni.hideLoading()
if (this.u && u.TenantId == 27) {
uni.navigateTo({
url: `/pages/order-submit/pay-success2?payInfo=${JSON.stringify(that.payInfo)}&StuId=${this.StuId}&TeacherIds=${this.TeacherIds}`
// url: '/pages/order-submit/pay-success2?payInfo='+JSON.stringify(that.payInfo)
});
} else {
uni.navigateTo({
url: '/pages/order-submit/pay-success?payInfo=' + JSON.stringify(that
.payInfo)
});
}
// uni.showToast({
// title:'支付成功'
// })
},
'fail': function(res) {
console.log(res, '=====')
uni.hideLoading()
uni.navigateTo({
// url: `/pages/order-submit/pay-success2?payInfo=${JSON.stringify(that.payInfo)}&StuId=${that.StuId}&TeacherIds=${that.TeacherIds}`
url: '/pages/order/index/index?status=1'
});
},
'complete': function(res) {
// uni.showToast({
// title:res.errMsg
// })
}
})
},
}
};
</script>
<style></style>
......@@ -48,7 +48,7 @@
<view class="store-list">
<template v-if="x.goods_list.length == 1">
<view class="goodbox" v-for="(y, yi) in x.goods_list" :key="yi">
<image :src="y.cover_pic" mode="aspectFill" class="image" />
<image :src="y.cover_pic" mode="scaleToFill" class="image" />
<view class="goodinfo">
<view class="name">
<view
......@@ -237,7 +237,7 @@
<view class="notOption" v-if="submitOrder"></view>
<good-list :list="goodData" v-if="showGoodList" @close="closeGoodListHandler"></good-list>
<payCom v-if="payBtn" :payInfo="payInfo" :isAlipay="isAlipay" @closePay="closePay"></payCom>
<payCom v-if="payBtn" :payInfo="payInfo" :isAlipay="isAlipay" :StuId='JJSWStuId' :TeacherIds='mrk' @closePay="closePay"></payCom>
<u-toast ref="uToast" />
<u-popup v-model="payExit" mode="center" :mask-close-able="false">
<view style="background:#fff;width:500rpx">
......@@ -326,6 +326,7 @@
},
data() {
return {
mrk:'',
isAlipay: 2,//1微信 2微信支付宝
JJSWStuId: "",
Thename2: '',
......@@ -718,6 +719,7 @@
});
},
init() {
let list =[]
this.loading = true;
this.request2({
url: '/api/AppletOrder/GetAppletGoodsSettlementInfoForZY',
......@@ -732,8 +734,12 @@
this.mchs.forEach(x => {
x.goods_list.forEach(j => {
j.marketingLogo = JSON.parse(j.marketingLogo)
list.push(j.EduTeacherId)
})
})
// console.log('88888888888888888',list)
this.mrk = list.toString()
// console.log('88888888888888888',this.mrk)
this.payInfo.GoodsName = this.mchs[0].goods_list[0].name.slice(0, 10);
this.formdata.DeliveryMethod = this.mchs[0].delivery.send_type;
this.ds = res.data;
......
......@@ -19,7 +19,7 @@
<view class="listBox_c">
<template v-if="item.DetailList.length == 1">
<view v-for="(cx, ci) in item.DetailList" :key="ci" class="box_bottom" @click="redirectToDetail(item)">
<image :src="cx.CoverImagePath" style="width: 80px; height: 80px; border-radius: 2px;" mode="aspectFill" />
<image :src="cx.CoverImagePath" style="width: 80px; height: 80px; border-radius: 2px;" mode="scaleToFill" />
<view style="margin-left: 15px; flex: 1;">
<Text class="topic_cont_text">{{cx.GoodsName}}</Text>
</view>
......@@ -34,7 +34,7 @@
<view class="goodboxmore" @click="redirectToDetail(item)">
<view class="good-list">
<view style="white-space: nowrap;">
<image v-for="(y, yi) in item.DetailList" :key="yi" :src="y.CoverImagePath" mode="aspectFill" class="item" />
<image v-for="(y, yi) in item.DetailList" :key="yi" :src="y.CoverImagePath" mode="scaleToFill" class="item" />
</view>
</view>
<view class="infos" @click.stop="showGoodListHandler(index)">
......@@ -96,7 +96,7 @@
<good-list :list="goodData" v-if="showGoodList" @close="closeGoodListHandler"></good-list>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth='goback'></auth>
<payCom v-if="payBtn&&u.TenantId!=27" :payInfo="payInfo" @closePay="closePay"></payCom>
<submit2PayCom v-if="payBtn&&u.TenantId==27" :payInfo="payInfo" :isAlipay="isAlipay" @closePay="closePay"></submit2PayCom>
<submit2PayCom v-if="payBtn&&u.TenantId==27" :payInfo="payInfo" :isAlipay="isAlipay" :StuId='StuId' :TeacherIds='TeacherIds' @closePay="closePay"></submit2PayCom>
<u-popup v-model="payExit" mode="center" :mask-close-able="false">
<view style="background:#fff;width:500rpx">
<view style="padding:10px 0 0 10px">提交失败</view>
......@@ -123,6 +123,8 @@
},
data() {
return {
StuId:'',
TeacherIds:'',
isAlipay:2,//1微信 2微信支付宝
pageTitle: "我的订单",
current: 0,
......@@ -321,10 +323,18 @@
this.Cancelmsg.Type = e.OrderStatus == 1 ? 1 : 2;
},
payment(e) {
let list =[]
this.payInfo.OrderId = e.OrderId;
this.payInfo.GoodsName = e.DetailList[0].GoodsName.slice(0, 10);
this.payInfo.PaymentWay = e.PaymentWay;
this.payInfo.total_price = e.Income;
this.StuId= e.JJSWStuId
e.DetailList.forEach(item=>{
list.push(item.EduTeacherId)
})
this.TeacherIds = list.toString()
// console.log('jjjjjjjjjj',this.StuId)
// console.log('lllllllllllllll',this.TeacherIds)
this.payBtn = true
},
exitPay() {
......
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