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.

sign-up-ali.vue 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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 class="content_3">
  20. 注:签约成功后请返回本页面,再次点击开通服务
  21. </view>
  22. </view>
  23. <view class="action">
  24. <button type="default" class="button" @click="savaHandle()">
  25. 开通服务
  26. </button>
  27. <!-- <button type="default" class="button" @click="addInterestsList()">
  28. 加购权益
  29. </button> -->
  30. </view>
  31. </template>
  32. <script setup lang="ts">
  33. import { onLoad, onShow } from "@dcloudio/uni-app";
  34. import { reactive } from "vue";
  35. import { etcQYAction } from "@/utils/network/api.js";
  36. import { request } from "@/utils/network/request.js";
  37. import { stringToJson } from "@/utils/network/encryption";
  38. import { fileURL } from "@/datas/fileURL.js";
  39. import navBar from "@/components/nav-bar/nav-bar2.vue";
  40. import navBgCar from "./components/nav-bg-car4";
  41. import { setItem } from "@/utils/storage";
  42. import { msg, confirm, getOrderStatusName } from "@/utils/utils";
  43. import {
  44. checkOrderStatus,
  45. orderPay,
  46. wechatAppID,
  47. wechatPayConfigId,
  48. wechatSecret,
  49. } from "@/utils/network/api";
  50. const imgURL = `${fileURL}image/`;
  51. const state = reactive({
  52. openid: "",
  53. orderId: "",
  54. id: "",
  55. clientFee: "",
  56. code:""
  57. });
  58. onLoad((option: any) => {
  59. state.orderId = option.orderId;
  60. });
  61. const addInterestsList=()=>{
  62. uni.navigateTo({
  63. url:`/subpackage/orders/interestsList?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}`
  64. });
  65. }
  66. const savaHandle = () => {
  67. my.getAuthCode({
  68. scopes: 'auth_user',
  69. success: res => {
  70. // 获取需要的用户信息
  71. state.code = res.authCode
  72. console.log("code*******", state.code);
  73. //如果获取openId成功
  74. if (state.code) {
  75. var data = {
  76. orderId: state.orderId,
  77. code: state.code,
  78. };
  79. const options = {
  80. type: 2,
  81. data: data,
  82. method: "POST",
  83. showLoading: true,
  84. };
  85. request(etcQYAction, options).then((res) => {
  86. console.log("res*******", res);
  87. const data = stringToJson(res.bizContent);
  88. console.log("data*******", data);
  89. if (data.signStatus === "WAIT_SIGN") {
  90. //待签约
  91. my.ap.navigateToAlipayPage({
  92. path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId="+data.alipayOrderId
  93. });
  94. }else if (data.signStatus === "SIGNED") {
  95. //已签约
  96. msg("已签约");
  97. confirm(
  98. "您已完成签约,等待业务员审核发货",
  99. () => {
  100. uni.$emit("refreshOrder");
  101. uni.navigateBack();
  102. },
  103. "已完成签约",
  104. false
  105. );
  106. }else if (data.signStatus === "UNSIGN") {
  107. //已解约
  108. msg("已解约");
  109. confirm(
  110. "您已解约!",
  111. () => {
  112. uni.$emit("refreshOrder");
  113. uni.navigateBack();
  114. },
  115. "您已解约",
  116. false
  117. );
  118. }
  119. });
  120. } else {
  121. //如果获取openId失败
  122. uni.showToast({
  123. title: "网络异常,请重试!",
  124. icon: "none",
  125. duration: 1000,
  126. });
  127. return;
  128. }
  129. },
  130. fail: err => {
  131. console.log('my.getAuthCode 调用失败', err)
  132. }
  133. });
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .action {
  138. margin-top: 40rpx;
  139. padding-left: 20rpx;
  140. padding-right: 20rpx;
  141. padding-bottom: 30rpx;
  142. .button {
  143. height: 80rpx;
  144. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  145. border-radius: 40rpx;
  146. font-size: 32rpx;
  147. font-weight: 400;
  148. color: #ffffff;
  149. line-height: 80rpx;
  150. }
  151. }
  152. .title {
  153. text-align: center;
  154. margin-top: 15rpx;
  155. font-size: 36rpx;
  156. font-family: Microsoft YaHei;
  157. font-weight: 400;
  158. color: #333333;
  159. line-height: 36rpx;
  160. }
  161. .value {
  162. padding: 0rpx 60rpx;
  163. }
  164. .content_1 {
  165. margin-top: 60rpx;
  166. font-size: 30rpx;
  167. font-family: Microsoft YaHei;
  168. font-weight: 400;
  169. color: #666666;
  170. line-height: 58rpx;
  171. }
  172. .content_2 {
  173. margin-top: 50rpx;
  174. font-size: 30rpx;
  175. font-family: Microsoft YaHei;
  176. font-weight: 400;
  177. color: #666666;
  178. line-height: 58rpx;
  179. }
  180. .content_3 {
  181. margin-top: 50rpx;
  182. font-size: 30rpx;
  183. font-family: Microsoft YaHei;
  184. font-weight: 400;
  185. color: #ff0000;
  186. line-height: 58rpx;
  187. }
  188. </style>