您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

sign-up-ali.vue 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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. wechatAppID,
  43. wechatPayConfigId,
  44. wechatSecret,
  45. aliPayConfigIdTwo,
  46. obtainUserId,
  47. } from "@/utils/network/api";
  48. const imgURL = `${fileURL}image/`;
  49. const state = reactive({
  50. openid: "",
  51. orderId: "",
  52. id: "",
  53. clientFee: "",
  54. code: "",
  55. qdOrderNo: "", //渠道订单编号
  56. });
  57. onLoad((option : any) => {
  58. console.log("option22222", option)
  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. console.log('支付结果查询params', params)
  125. uni.navigateTo({
  126. url: `/subpackage/personal-center/webview?url=` + params
  127. })
  128. },
  129. "已完成签约",
  130. false
  131. );
  132. } else if (data.signStatus === "UNSIGN") {
  133. //已解约
  134. // msg("已解约");
  135. confirm(
  136. "您已解约!",
  137. () => {
  138. // uni.switchTab({
  139. // url: "/pages/order/order"
  140. // })
  141. },
  142. "您已解约",
  143. false
  144. );
  145. }
  146. });
  147. })
  148. } else {
  149. //如果获取openId失败
  150. uni.showToast({
  151. title: "网络异常,请重试!",
  152. icon: "none",
  153. duration: 1000,
  154. });
  155. return;
  156. }
  157. },
  158. fail: err => {
  159. console.log('my.getAuthCode 调用失败', err)
  160. }
  161. });
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .action {
  166. margin-top: 40rpx;
  167. padding-left: 20rpx;
  168. padding-right: 20rpx;
  169. padding-bottom: 30rpx;
  170. .button {
  171. height: 80rpx;
  172. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  173. border-radius: 40rpx;
  174. font-size: 32rpx;
  175. font-weight: 400;
  176. color: #ffffff;
  177. line-height: 80rpx;
  178. }
  179. }
  180. .title {
  181. text-align: center;
  182. margin-top: 15rpx;
  183. font-size: 36rpx;
  184. font-family: Microsoft YaHei;
  185. font-weight: 400;
  186. color: #333333;
  187. line-height: 36rpx;
  188. }
  189. .value {
  190. padding: 0rpx 60rpx;
  191. }
  192. .content_1 {
  193. margin-top: 60rpx;
  194. font-size: 30rpx;
  195. font-family: Microsoft YaHei;
  196. font-weight: 400;
  197. color: #666666;
  198. line-height: 58rpx;
  199. }
  200. .content_2 {
  201. margin-top: 50rpx;
  202. font-size: 30rpx;
  203. font-family: Microsoft YaHei;
  204. font-weight: 400;
  205. color: #666666;
  206. line-height: 58rpx;
  207. }
  208. .content_3 {
  209. margin-top: 50rpx;
  210. font-size: 30rpx;
  211. font-family: Microsoft YaHei;
  212. font-weight: 400;
  213. color: #ff0000;
  214. line-height: 58rpx;
  215. }
  216. </style>