洛阳学员端
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.

273 lines
7.2 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
7 months ago
10 months ago
7 months ago
10 months ago
10 months ago
8 months ago
10 months ago
8 months ago
7 months ago
8 months ago
7 months ago
10 months ago
7 months ago
10 months ago
7 months ago
10 months ago
10 months ago
7 months ago
10 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
7 months ago
10 months ago
10 months ago
7 months ago
10 months ago
10 months ago
7 months ago
10 months ago
7 months ago
10 months ago
10 months ago
7 months ago
10 months ago
7 months ago
10 months ago
10 months ago
10 months ago
7 months ago
10 months ago
10 months ago
7 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">翔力驾校</view>
  7. <view class="price">
  8. <text class="uint"></text>{{ info.a }}
  9. </view>
  10. <!-- <view class="num">交易单号65465879312</view> -->
  11. </view>
  12. <view class="li border">
  13. <view class="lab">订单金额</view>
  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="getYSBLink">确认支付</view>
  48. </view>
  49. <web-view :src="link" v-if="link" @load="loadWebView"></web-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. link: ''
  65. }
  66. },
  67. onLoad(options) {
  68. if (options.trainingApplyId) {
  69. this.trainingApplyId = options.trainingApplyId
  70. }
  71. // this.getYSBLink()
  72. this.getStudentByPayment()
  73. this.initWx()
  74. },
  75. onPullDownRefresh() {
  76. this.getStudentByPayment()
  77. },
  78. methods: {
  79. initWx() {
  80. // #ifdef APP-PLUS
  81. plus.share.getServices((s) => {
  82. var shares = {};
  83. for (var i = 0; i < s.length; i++) {
  84. var t = s[i];
  85. console.log("...........", t);
  86. shares[t.id] = t;
  87. }
  88. var sweixin = shares['weixin'];
  89. this.sweixin = sweixin
  90. }, function(e) {
  91. console.log("获取分享服务列表失败:" + e.message);
  92. });
  93. // #endif
  94. },
  95. wxPay(data) {
  96. // const data = {
  97. // channelNo: 'QD202401250001', //易收宝分配的渠道号
  98. // encodeData: '', //{"outOrderNo":"15456","timestamp":"1632815312300"},json进行加签加密后的值,outOrderNo商户订单号
  99. // miniAppName: '', //第三方小程序的名称
  100. // env: '',// u8、u6为测试环境,prod为生产环境
  101. // distinctId: '',//第三方小程序的用户唯一标识
  102. // unionMode: 'miniProToMiniPro', // 微信跳转微信小程序时使用
  103. // }
  104. // #ifdef APP-PLUS
  105. // this.sweixin ? this.sweixin.launchMiniProgram({
  106. // appId: 'wx9e7d9eea420f6541', //易收宝小程序的appid 测试环境:wx9e7d9eea420f6541 生产环境:wx05c2e4857b6806c8
  107. // path: `/pages/ysbCheckStand/ysbCheckStand?data=${JSON.stringify(data)}`, //跳转小程序页面路径 pages/index/index
  108. // envVersion: 'trial', // 打开体验版trial, 正式版release
  109. // }) : plus.nativeUI.alert('当前环境不支持微信操作!');
  110. this.sweixin ? this.sweixin.launchMiniProgram({
  111. miniAppId: 'wx9e7d9eea420f6541', //小程序原始ID
  112. path: '', //跳转小程序的页面路径,可携带参数
  113. miniProgramType: '1', //小程序的版本 0正式版 1开发版 2体验版
  114. }) : plus.nativeUI.alert('当前环境不支持微信操作!');
  115. // #endif
  116. },
  117. async getStudentByPayment() {
  118. const {
  119. data: res
  120. } = await pre_create({
  121. trainingApplyId: this.trainingApplyId
  122. })
  123. console.log('创建的订单信息')
  124. // console.log(res.orderNo)
  125. this.encodeData = res.encodeData
  126. // this.param_sign(res.orderNo)
  127. // await this.getYSBLink(res.encodeData)
  128. // this.wxPay()
  129. // this.$store.dispatch('getUserInfo')
  130. // setTimeout(()=>{
  131. // this.wxPay()
  132. // },1500)
  133. },
  134. // 加密数据
  135. async param_sign(outOrderNo) {
  136. let obj = {
  137. outOrderNo,
  138. timestamp: Date.now()
  139. }
  140. console.log(JSON.stringify(obj))
  141. const {data: res} = await param_sign({jsonParam:JSON.stringify(obj)})
  142. console.log('加密后的数据')
  143. console.log(res.encodeData)
  144. },
  145. getYSBLink() {
  146. if(!this.encodeData) return this.$u.toast('没有获取到支付信息')
  147. const channelNo = 'QD202404083509';
  148. //common普通的h5平台,如果当前的运行环境为微信小程序则platform的值为pay_miniPro
  149. const platform = 'common';
  150. //易收宝H5的前端页面地址,不同的环境详见第四章第4节
  151. // 测试地址
  152. // const preUrl = 'https://ft1wbs.zyebank.cn/cem_ysb_ft2/index.html'
  153. const preUrl = 'https://u8wbs.zyebank.cn/cem_ysb_u8/index.html'
  154. // 生产地址
  155. // const preUrl = 'https://zmcht.zybank.com.cn/cem_ysb/index.html';
  156. // let obj = {"outOrderNo":orderNo || "2024041211570300000308","timestamp":"1632815312300"}
  157. // const encodeData = encodeData
  158. // 用户的唯一标识(可以区分出用户的唯一性即可),-缓存银行卡信息
  159. const distinctId = this.userId
  160. const callback = `${preUrl}?encodeData=${this.encodeData}#/checkStandPre?platform=${platform}&channelNo=${channelNo}&checkStand_v3=true&distinctId=${distinctId}`;
  161. this.link = callback;
  162. console.log('callback')
  163. console.log(callback)
  164. },
  165. loadWebView() {
  166. console.log('会来到vebview事件里吗?')
  167. this.wxPay()
  168. },
  169. paySubmit() {
  170. console.log('这是什么')
  171. console.log(this.sweixin)
  172. this.wxPay()
  173. // this.$goPage('/pages/indexEntry/enroll/paymentSuccess/paymentSuccess')
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .card {
  180. width: 100%;
  181. margin-bottom: 20rpx;
  182. padding: 0 20rpx;
  183. .orderInfo {
  184. text-align: center;
  185. .schoolName {
  186. font-size: 28rpx;
  187. color: #ccc;
  188. padding: 40rpx 0 20rpx 0;
  189. }
  190. .price {
  191. font-size: 72rpx;
  192. font-weight: 600;
  193. text.uint {
  194. font-size: 44rpx;
  195. font-weight: 600;
  196. }
  197. }
  198. .num {
  199. font-size: 24rpx;
  200. color: #ADADAD;
  201. }
  202. }
  203. .li {
  204. display: flex;
  205. height: 88rpx;
  206. line-height: 88rpx;
  207. &.border {
  208. border-bottom: 1px solid #F6F7FA;
  209. }
  210. .lab {
  211. color: #ccc;
  212. width: 230rpx;
  213. }
  214. .val {
  215. font-weight: 500;
  216. flex: 1;
  217. text-align: right;
  218. }
  219. }
  220. }
  221. .pay {
  222. .h2 {
  223. font-size: 32rpx;
  224. font-weight: 500;
  225. margin-bottom: 24rpx;
  226. }
  227. .row {
  228. display: flex;
  229. justify-content: space-between;
  230. align-items: center;
  231. height: 88rpx;
  232. &.border {
  233. border-bottom: 1px solid #F6F7FA;
  234. }
  235. .wxIcon {
  236. width: 40rpx;
  237. height: 40rpx;
  238. }
  239. .text {
  240. margin-left: 20rpx;
  241. flex: 1;
  242. text-align: left;
  243. font-size: 28rpx;
  244. color: #333;
  245. }
  246. .icon {
  247. width: 40rpx;
  248. height: 40rpx;
  249. }
  250. }
  251. }
  252. </style>