您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

product-detail.vue 2.8KB

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