Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

product-detail.vue 4.2KB

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