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 2.6KB

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