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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <image
  3. style="
  4. margin-top: 20rpx;
  5. width: 100%;
  6. height: 240rpx;
  7. background-color: #eeeeee;
  8. "
  9. :src="`${$imgUrl}applyCard/car-service.png`"
  10. ></image>
  11. <view class="title"> 微信车主服务 </view>
  12. <view class="value">
  13. <view class="content_1">
  14. 微信车主服务是微信支付为车主用户提供的安全便捷的智慧服务
  15. </view>
  16. <view class="content_2">
  17. 本次将为安徽高灯微行科技有限公司开启免密支付服务,后续相关的费用将通过微信车主服务从你的微信支付账户扣除
  18. </view>
  19. </view>
  20. <view class="action">
  21. <button type="default" class="button" @click="savaHandle()">
  22. 开通服务
  23. </button>
  24. </view>
  25. </template>
  26. <script setup lang="ts">
  27. import { onLoad, onShow } from "@dcloudio/uni-app";
  28. import { reactive } from "vue";
  29. import { etcQYAction } from "@/utils/network/api.js";
  30. import { request } from "@/utils/network/request.js";
  31. import { stringToJson } from "@/utils/network/encryption";
  32. import { fileURL } from "@/datas/fileURL.js";
  33. import navBar from "../../components/nav-bar/nav-bar2.vue";
  34. import navBgCar from "./components/nav-bg-car4";
  35. import { getItem, StorageKeys } from "@/utils/storage.ts";
  36. import { msg } from "@/utils/utils";
  37. import {
  38. checkOrderStatus,
  39. orderPay,
  40. wechatAppID,
  41. wechatPayConfigId,
  42. wechatSecret,
  43. } from "@/utils/network/api";
  44. const imgURL = `${fileURL}image/`;
  45. const savaHandle = () => {
  46. // var data = {
  47. // orderId: state.orderId,
  48. // subOpenId: state.openid
  49. // }
  50. // const options = {
  51. // type: 2,
  52. // data: data,
  53. // method: 'POST',
  54. // showLoading: true,
  55. // }
  56. // request(etcQYAction, options).then((res) => {
  57. // const data = stringToJson(res.bizContent);
  58. // uni.navigateToMiniProgram({
  59. // appId: data.appId,
  60. // path: data.path,
  61. // extraData: {
  62. // appid: data.appid,
  63. // sub_appid: data.subAppid,
  64. // mch_id: data.mchId,
  65. // sub_mch_id: data.subMchId,
  66. // nonce_str: data.nonceStr,
  67. // sign_type: "HMAC-SHA256",
  68. // sign: data.sign,
  69. // trade_scene: data.tradeScene,
  70. // plate_number: data.plateNum,
  71. // sub_openid: data.subOpenId,
  72. // channel_type: data.channelType,
  73. // },
  74. // success(res) {
  75. // console.log(res);
  76. // },
  77. // complete(res) {
  78. // },
  79. // fail(res) {
  80. // // 未成功跳转到车主小程序
  81. // },
  82. // });
  83. // })
  84. };
  85. const state = reactive({
  86. openid: "",
  87. orderId: "",
  88. });
  89. onLoad((option: any) => {
  90. getOpenID();
  91. state.orderId = option.orderId;
  92. });
  93. //获取微信小程序openid
  94. const getOpenID = () => {
  95. uni.login({
  96. provider: "weixin",
  97. success: function (e) {
  98. uni.request({
  99. url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`,
  100. success: (res: any) => {
  101. state.openid = res.data.openid;
  102. },
  103. });
  104. },
  105. });
  106. };
  107. </script>
  108. <style lang="scss" scoped>
  109. .action {
  110. margin-top: 40rpx;
  111. padding-left: 20rpx;
  112. padding-right: 20rpx;
  113. padding-bottom: 30rpx;
  114. .button {
  115. height: 80rpx;
  116. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  117. border-radius: 40rpx;
  118. font-size: 32rpx;
  119. font-weight: 400;
  120. color: #ffffff;
  121. line-height: 80rpx;
  122. }
  123. }
  124. .title {
  125. text-align: center;
  126. margin-top: 15rpx;
  127. font-size: 36rpx;
  128. font-family: Microsoft YaHei;
  129. font-weight: 400;
  130. color: #333333;
  131. line-height: 36rpx;
  132. }
  133. .value {
  134. padding: 0rpx 60rpx;
  135. }
  136. .content_1 {
  137. margin-top: 60rpx;
  138. font-size: 30rpx;
  139. font-family: Microsoft YaHei;
  140. font-weight: 400;
  141. color: #666666;
  142. line-height: 58rpx;
  143. }
  144. .content_2 {
  145. margin-top: 50rpx;
  146. font-size: 30rpx;
  147. font-family: Microsoft YaHei;
  148. font-weight: 400;
  149. color: #666666;
  150. line-height: 58rpx;
  151. }
  152. </style>