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.

product-detail.vue 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 { 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. };
  43. const state = reactive({
  44. openid: "",
  45. orderId: "",
  46. });
  47. onLoad((option : any) => {
  48. getOpenID();
  49. state.orderId = option.orderId;
  50. });
  51. //获取微信小程序openid
  52. const getOpenID = () => {
  53. uni.login({
  54. provider: "weixin",
  55. success: function (e) {
  56. getOpenid(e.code)
  57. },
  58. });
  59. };
  60. const getOpenid = (code) => {
  61. const options = {
  62. type: 2,
  63. data: {
  64. "jsCode": code
  65. },
  66. method: "POST",
  67. showLoading: true,
  68. };
  69. // #ifdef MP-WEIXIN
  70. request(getOpenidApi, options).then((res) => {
  71. const result = stringToJson(res.bizContent);
  72. console.log("获取微信小程序openid", result);
  73. const openidData = stringToJson(result.data);
  74. state.openid = openidData.openid
  75. });
  76. // #endif
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .action {
  81. margin-top: 40rpx;
  82. padding-left: 20rpx;
  83. padding-right: 20rpx;
  84. padding-bottom: 30rpx;
  85. .button {
  86. height: 80rpx;
  87. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  88. border-radius: 40rpx;
  89. font-size: 32rpx;
  90. font-weight: 400;
  91. color: #ffffff;
  92. line-height: 80rpx;
  93. }
  94. }
  95. .title {
  96. text-align: center;
  97. margin-top: 15rpx;
  98. font-size: 36rpx;
  99. font-family: Microsoft YaHei;
  100. font-weight: 400;
  101. color: #333333;
  102. line-height: 36rpx;
  103. }
  104. .value {
  105. padding: 0rpx 60rpx;
  106. }
  107. .content_1 {
  108. margin-top: 60rpx;
  109. font-size: 30rpx;
  110. font-family: Microsoft YaHei;
  111. font-weight: 400;
  112. color: #666666;
  113. line-height: 58rpx;
  114. }
  115. .content_2 {
  116. margin-top: 50rpx;
  117. font-size: 30rpx;
  118. font-family: Microsoft YaHei;
  119. font-weight: 400;
  120. color: #666666;
  121. line-height: 58rpx;
  122. }
  123. </style>