洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
5.5 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
10 months ago
8 months ago
10 months ago
8 months ago
8 months ago
8 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
10 months ago
8 months ago
8 months ago
10 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
10 months ago
10 months ago
8 months ago
10 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
10 months ago
10 months ago
8 months ago
10 months ago
10 months ago
8 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="pageBg">
  3. <view class="pad">
  4. <view class="card">
  5. <view class="orderInfo">
  6. <view class="schoolName">{{schoolName}}</view>
  7. <view class="price">
  8. <text class="uint" v-if="amount"></text>{{ $u.utils.priceTo(amount) }}
  9. </view>
  10. <!-- <view class="num">交易单号65465879312</view> -->
  11. </view>
  12. <!-- <view class="li border">
  13. amount
  14. <view class="val"> {{info.a}}</view>
  15. </view> -->
  16. <!-- <view class="li">
  17. <view class="lab">订单编号</view>
  18. <view class="val">{{info.a}}</view>
  19. </view> -->
  20. </view>
  21. <view class="card">
  22. <view class="pay">
  23. <!-- <view class="h2">选择支付方式</view> -->
  24. <!-- <view class="row border">
  25. <view class="wxIcon">
  26. <image src="@/static/images/carIcon/xfbIcon.png" mode=""></image>
  27. </view>
  28. <view class="text">支付宝</view>
  29. <view class="icon">
  30. <!-- <image src="@/static/images/index/noSelect.png" mode=""></image> -->
  31. <!-- <image src="@/static/images/carIcon/isSelect.png" mode=""></image>
  32. </view> -->
  33. </view>
  34. <!-- <view class="row">
  35. <view class="wxIcon">
  36. <image src="@/static/images/carIcon/wxIcon.png" mode=""></image>
  37. </view>
  38. <view class="text">微信</view>
  39. <view class="icon">
  40. <image src="@/static/images/index/noSelect.png" mode=""></image>
  41. <image src="@/static/images/carIcon/isSelect.png" mode=""></image>
  42. </view>
  43. </view> -->
  44. </view>
  45. </view>
  46. <view class="footerBtn pad">
  47. <view class="btnBg" @click="getStudentByPayment()">确认支付</view>
  48. <!-- <view class="btnBg" @click="paySubmit">确认支付</view> -->
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import {
  55. getStudentByPayment, pre_create, param_sign
  56. } from '@/config/api.js'
  57. export default {
  58. data() {
  59. return {
  60. trainingApplyId: '',
  61. info: {
  62. a: '待对接'
  63. },
  64. schoolName: '',
  65. amount: '0',
  66. }
  67. },
  68. onLoad(options) {
  69. if (options.trainingApplyId) {
  70. this.trainingApplyId = options.trainingApplyId
  71. }
  72. // this.getYSBLink()
  73. this.getStudentByPayment()
  74. this.initWx()
  75. },
  76. onPullDownRefresh() {
  77. // this.getStudentByPayment()
  78. },
  79. methods: {
  80. initWx() {
  81. // #ifdef APP-PLUS
  82. plus.share.getServices((s) => {
  83. var shares = {};
  84. for (var i = 0; i < s.length; i++) {
  85. var t = s[i];
  86. console.log("...........", t);
  87. shares[t.id] = t;
  88. }
  89. var sweixin = shares['weixin'];
  90. this.sweixin = sweixin
  91. }, function(e) {
  92. console.log("获取分享服务列表失败:" + e.message);
  93. });
  94. // #endif
  95. },
  96. async getStudentByPayment(type) {
  97. console.log('来到了这没有')
  98. const {
  99. data: res
  100. } = await pre_create({
  101. trainingApplyId: this.trainingApplyId
  102. })
  103. this.amount = res.amount
  104. this.schoolName = res.schoolName
  105. console.log('创建的订单信息')
  106. console.log(res)
  107. this.param_sign(res.orderNo)
  108. },
  109. // 加密数据
  110. async param_sign(outOrderNo) {
  111. let obj = {
  112. outOrderNo,
  113. timestamp: Date.now()
  114. }
  115. console.log(JSON.stringify(obj))
  116. const {data: res} = await param_sign({jsonParam:JSON.stringify(obj)})
  117. this.encodeData = res.encodeData
  118. console.log('加密后的数据')
  119. console.log(res.encodeData)
  120. this.getYSBLink()
  121. },
  122. async getYSBLink() {
  123. if(!this.encodeData) return this.$u.toast('没有获取到支付信息')
  124. const channelNo = 'QD202404083509';
  125. //common普通的h5平台,如果当前的运行环境为微信小程序则platform的值为pay_miniPro
  126. const platform = 'common';
  127. //易收宝H5的前端页面地址,不同的环境详见第四章第4节
  128. // 测试地址
  129. // const preUrl = 'https://ft1wbs.zyebank.cn/cem_ysb_ft2/index.html'
  130. const preUrl = 'https://u8wbs.zyebank.cn/cem_ysb_u8/index.html'
  131. // 生产地址
  132. // const preUrl = 'https://zmcht.zybank.com.cn/cem_ysb/index.html';
  133. // let obj = {"outOrderNo":orderNo || "2024041211570300000308","timestamp":"1632815312300"}
  134. const distinctId = this.userId
  135. const payLink = `${preUrl}?encodeData=${this.encodeData}#/checkStandPre?platform=${platform}&channelNo=${channelNo}&checkStand_v3=true&distinctId=${distinctId}`;
  136. console.log('payLink')
  137. console.log(payLink)
  138. this.$store.commit('updateWebVeiwUrl', payLink)
  139. this.$goPage('/pages/indexEntry/enroll/payment/payh5')
  140. },
  141. }
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. .card {
  146. width: 100%;
  147. margin-bottom: 20rpx;
  148. padding: 0 20rpx;
  149. .orderInfo {
  150. text-align: center;
  151. .schoolName {
  152. font-size: 28rpx;
  153. color: #ccc;
  154. padding: 40rpx 0 20rpx 0;
  155. }
  156. .price {
  157. font-size: 72rpx;
  158. font-weight: 600;
  159. text.uint {
  160. font-size: 44rpx;
  161. font-weight: 600;
  162. }
  163. }
  164. .num {
  165. font-size: 24rpx;
  166. color: #ADADAD;
  167. }
  168. }
  169. .li {
  170. display: flex;
  171. height: 88rpx;
  172. line-height: 88rpx;
  173. &.border {
  174. border-bottom: 1px solid #F6F7FA;
  175. }
  176. .lab {
  177. color: #ccc;
  178. width: 230rpx;
  179. }
  180. .val {
  181. font-weight: 500;
  182. flex: 1;
  183. text-align: right;
  184. }
  185. }
  186. }
  187. .pay {
  188. .h2 {
  189. font-size: 32rpx;
  190. font-weight: 500;
  191. margin-bottom: 24rpx;
  192. }
  193. .row {
  194. display: flex;
  195. justify-content: space-between;
  196. align-items: center;
  197. height: 88rpx;
  198. &.border {
  199. border-bottom: 1px solid #F6F7FA;
  200. }
  201. .wxIcon {
  202. width: 40rpx;
  203. height: 40rpx;
  204. }
  205. .text {
  206. margin-left: 20rpx;
  207. flex: 1;
  208. text-align: left;
  209. font-size: 28rpx;
  210. color: #333;
  211. }
  212. .icon {
  213. width: 40rpx;
  214. height: 40rpx;
  215. }
  216. }
  217. }
  218. </style>