Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

sign-up-ali.vue 5.1KB

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