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

成功页面新

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