Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

sign-up.vue 5.4KB

il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. <button type="default" class="button" @click="addInterestsList()">
  25. 加购权益
  26. </button>
  27. </view>
  28. </template>
  29. <script setup lang="ts">
  30. import { onLoad, onShow } from "@dcloudio/uni-app";
  31. import { reactive } from "vue";
  32. import { etcQYAction } from "@/utils/network/api.js";
  33. import { request } from "@/utils/network/request.js";
  34. import { stringToJson } from "@/utils/network/encryption";
  35. import { fileURL } from "@/datas/fileURL.js";
  36. import navBar from "@/components/nav-bar/nav-bar2.vue";
  37. import navBgCar from "./components/nav-bg-car4";
  38. import { setItem } from "@/utils/storage";
  39. import { msg} from "@/utils/utils";
  40. import {
  41. checkOrderStatus,
  42. orderPay,
  43. wechatAppID,
  44. wechatPayConfigId,
  45. wechatSecret,
  46. } from "@/utils/network/api";
  47. const imgURL = `${fileURL}image/`;
  48. const state = reactive({
  49. openid: "",
  50. orderId: "",
  51. id: "",
  52. clientFee: "",
  53. });
  54. onLoad((option: any) => {
  55. getOpenID();
  56. state.orderId = option.orderId;
  57. state.clientFee = option.clientFee;
  58. state.id = option.id;
  59. });
  60. //获取微信小程序openid
  61. const getOpenID = () => {
  62. uni.login({
  63. provider: "weixin",
  64. success: function (e) {
  65. console.log(e);
  66. uni.request({
  67. url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`,
  68. success: (res: any) => {
  69. state.openid = res.data.openid;
  70. setItem("QYorder", state);
  71. console.log(res);
  72. },
  73. fail: (err: any) => {
  74. uni.showToast({
  75. title: "网络异常,请重试!" + err.errcode,
  76. icon: "error",
  77. duration: 500,
  78. });
  79. return;
  80. },
  81. });
  82. },
  83. });
  84. };
  85. const addInterestsList=()=>{
  86. uni.navigateTo({
  87. url:`/subpackage/applyCard/interestsList?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}`
  88. });
  89. }
  90. const savaHandle = () => {
  91. console.log("openid*******", state.openid);
  92. //如果获取openId成功
  93. if (state.openid) {
  94. var data = {
  95. orderId: state.orderId,
  96. subOpenId: state.openid,
  97. };
  98. const options = {
  99. type: 2,
  100. data: data,
  101. method: "POST",
  102. showLoading: true,
  103. };
  104. request(etcQYAction, options).then((res) => {
  105. const data = stringToJson(res.bizContent);
  106. if (data.userState === "UNAUTHORIZED") {
  107. uni.navigateToMiniProgram({
  108. appId: "wxbcad394b3d99dac9",
  109. path: "pages/route/index",
  110. extraData: {
  111. appid: "wxcb1388c809fe25a9",
  112. sub_appid: "wx008c60533388527a",
  113. mch_id: "1500877591",
  114. sub_mch_id: "1622652848",
  115. nonce_str: data.nonceStr,
  116. sign_type: "HMAC-SHA256",
  117. trade_scene: "HIGHWAY",
  118. plate_number: data.plateNumber,
  119. sub_openid: data.subOpenId,
  120. sign: data.sign,
  121. },
  122. success(res) {
  123. console.log(res);
  124. },
  125. complete(res) {
  126. console.log(res);
  127. },
  128. fail(res) {
  129. console.log(res);
  130. // 未成功跳转到车主小程序
  131. },
  132. });
  133. } else if (data.userState === "NORMAL") {
  134. msg("已开通车主服务");
  135. uni.navigateTo({
  136. url: `/subpackage/applyCard/product-detail?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}`,
  137. });
  138. } else if (data.userState === "PAUSED") {
  139. msg("已暂停车主服务");
  140. return;
  141. } else if (data.userState === "OVERDUE") {
  142. msg("用户已开通车主服务,但欠费状态。提示用户还款,请跳转到车主服务");
  143. return;
  144. }
  145. });
  146. } else {
  147. //如果获取openId失败
  148. uni.showToast({
  149. title: "网络异常,请重试!",
  150. icon: "none",
  151. duration: 1000,
  152. });
  153. return;
  154. }
  155. };
  156. </script>
  157. <style lang="scss" scoped>
  158. .action {
  159. margin-top: 40rpx;
  160. padding-left: 20rpx;
  161. padding-right: 20rpx;
  162. padding-bottom: 30rpx;
  163. .button {
  164. height: 80rpx;
  165. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  166. border-radius: 40rpx;
  167. font-size: 32rpx;
  168. font-weight: 400;
  169. color: #ffffff;
  170. line-height: 80rpx;
  171. }
  172. }
  173. .title {
  174. text-align: center;
  175. margin-top: 15rpx;
  176. font-size: 36rpx;
  177. font-family: Microsoft YaHei;
  178. font-weight: 400;
  179. color: #333333;
  180. line-height: 36rpx;
  181. }
  182. .value {
  183. padding: 0rpx 60rpx;
  184. }
  185. .content_1 {
  186. margin-top: 60rpx;
  187. font-size: 30rpx;
  188. font-family: Microsoft YaHei;
  189. font-weight: 400;
  190. color: #666666;
  191. line-height: 58rpx;
  192. }
  193. .content_2 {
  194. margin-top: 50rpx;
  195. font-size: 30rpx;
  196. font-family: Microsoft YaHei;
  197. font-weight: 400;
  198. color: #666666;
  199. line-height: 58rpx;
  200. }
  201. </style>