Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

sign-up-ali.vue 5.6KB

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