Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

sign-up-ali.vue 5.8KB

1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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 class="content_3">
  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, StorageKeys } from "@/utils/storage";
  39. import { msg, confirm, getOrderStatusName } from "@/utils/utils";
  40. import {
  41. checkOrderStatus,
  42. orderPay,
  43. wechatAppID,
  44. wechatPayConfigId,
  45. wechatSecret,
  46. aliPayConfigIdTwo,
  47. obtainUserId,
  48. } from "@/utils/network/api";
  49. const imgURL = `${fileURL}image/`;
  50. const state = reactive({
  51. openid: "",
  52. orderId: "",
  53. id: "",
  54. clientFee: "",
  55. code: "",
  56. qdOrderNo: "", //渠道订单编号
  57. });
  58. onLoad((option : any) => {
  59. state.orderId = option.orderId;
  60. state.qdOrderNo = option.qdOrderNo;
  61. setItem('accessToken', option.token);
  62. setItem(StorageKeys.Token, option.token);
  63. setItem('openId', option.openId);
  64. });
  65. const addInterestsList = () => {
  66. uni.navigateTo({
  67. url: `/subpackage/orders/interestsList?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}`
  68. });
  69. }
  70. const savaHandle = () => {
  71. my.getAuthCode({
  72. scopes: 'auth_user',
  73. success: res => {
  74. // 获取需要的用户信息
  75. state.code = res.authCode
  76. //如果获取openId成功
  77. if (state.code) {
  78. console.log("code*******", state.code);
  79. const optionsUser = {
  80. type: 2,
  81. data: {
  82. payConfigId: aliPayConfigIdTwo,
  83. code: res.authCode
  84. },
  85. method: "POST",
  86. showLoading: true,
  87. };
  88. console.log('支付宝用户编号请求:', optionsUser)
  89. request(obtainUserId, optionsUser).then((res) => {
  90. console.log('支付宝用户编号返回:', res)
  91. const bizContent = stringToJson(res.bizContent);
  92. var data = {
  93. orderId: state.orderId,
  94. subOpenId: bizContent.openId,
  95. };
  96. const options = {
  97. type: 2,
  98. data: data,
  99. method: "POST",
  100. showLoading: true,
  101. };
  102. request(etcQYAction, options).then((res) => {
  103. console.log("res*******", res);
  104. const data = stringToJson(res.bizContent);
  105. console.log("data*******", data);
  106. if (data.signStatus === "WAIT_SIGN") {
  107. //待签约
  108. my.ap.navigateToAlipayPage({
  109. path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId=" + data.alipayOrderId
  110. });
  111. } else if (data.signStatus === "SIGNED") {
  112. //已签约
  113. // msg("已签约");
  114. confirm(
  115. "您已完成签约,等待业务员审核发货",
  116. () => {
  117. // uni.switchTab({
  118. // url: "/pages/order/order"
  119. // })
  120. // uni.$emit("refreshOrder");
  121. // uni.navigateBack();
  122. const param = `https://qtzl.etcjz.cn/order/#/pages/sigManage/signContract?qdOrderNo=${state.qdOrderNo}&type=3`
  123. const params = encodeURIComponent(JSON.stringify(param))
  124. uni.navigateTo({
  125. url: `/subpackage/personal-center/webview?url=` + params
  126. })
  127. },
  128. "已完成签约",
  129. false
  130. );
  131. } else if (data.signStatus === "UNSIGN") {
  132. //已解约
  133. // msg("已解约");
  134. confirm(
  135. "您已解约!",
  136. () => {
  137. // uni.switchTab({
  138. // url: "/pages/order/order"
  139. // })
  140. },
  141. "您已解约",
  142. false
  143. );
  144. }
  145. });
  146. })
  147. } else {
  148. //如果获取openId失败
  149. uni.showToast({
  150. title: "网络异常,请重试!",
  151. icon: "none",
  152. duration: 1000,
  153. });
  154. return;
  155. }
  156. },
  157. fail: err => {
  158. console.log('my.getAuthCode 调用失败', err)
  159. }
  160. });
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. .action {
  165. margin-top: 40rpx;
  166. padding-left: 20rpx;
  167. padding-right: 20rpx;
  168. padding-bottom: 30rpx;
  169. .button {
  170. height: 80rpx;
  171. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  172. border-radius: 40rpx;
  173. font-size: 32rpx;
  174. font-weight: 400;
  175. color: #ffffff;
  176. line-height: 80rpx;
  177. }
  178. }
  179. .title {
  180. text-align: center;
  181. margin-top: 15rpx;
  182. font-size: 36rpx;
  183. font-family: Microsoft YaHei;
  184. font-weight: 400;
  185. color: #333333;
  186. line-height: 36rpx;
  187. }
  188. .value {
  189. padding: 0rpx 60rpx;
  190. }
  191. .content_1 {
  192. margin-top: 60rpx;
  193. font-size: 30rpx;
  194. font-family: Microsoft YaHei;
  195. font-weight: 400;
  196. color: #666666;
  197. line-height: 58rpx;
  198. }
  199. .content_2 {
  200. margin-top: 50rpx;
  201. font-size: 30rpx;
  202. font-family: Microsoft YaHei;
  203. font-weight: 400;
  204. color: #666666;
  205. line-height: 58rpx;
  206. }
  207. .content_3 {
  208. margin-top: 50rpx;
  209. font-size: 30rpx;
  210. font-family: Microsoft YaHei;
  211. font-weight: 400;
  212. color: #ff0000;
  213. line-height: 58rpx;
  214. }
  215. </style>