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.

signContract.vue 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. </template>
  3. <script setup lang='ts'>
  4. import {
  5. unifyTemplate
  6. } from '@/hooks/unifyTemplate'
  7. import {
  8. onLoad
  9. } from '@dcloudio/uni-app';
  10. import {
  11. request
  12. } from '@/utils/network/request'
  13. const {
  14. initData, //初始化数据
  15. } = unifyTemplate() //初始化数据
  16. //获取页面配置
  17. onLoad((opin) => {
  18. initData(opin, 3).then(data => {
  19. contractTesting(data.qdOrder.qdOrderNo, data.config.jumpPage)
  20. })
  21. })
  22. // 关闭当前页面方法
  23. function closeWin() {
  24. // @ts-ignore
  25. var jWeixin = import('jweixin-module')
  26. // @ts-ignore
  27. jWeixin.miniProgram.getEnv(function(res) {
  28. if (res.miniprogram) {
  29. // @ts-ignore
  30. jWeixin.miniProgram.navigateTo({
  31. url: '/path/to/page'
  32. })
  33. } else {
  34. const opened = window.open('about:blank', '_self');
  35. opened.opener = null;
  36. opened.close()
  37. }
  38. })
  39. }
  40. // 签约检测
  41. function contractTesting(qdOrderNo, jumpPage) {
  42. const data = {
  43. qdOrderNo,
  44. }
  45. // uni.navigateTo({
  46. // url: '/' + jumpPage,
  47. // animationType: 'pop-in',
  48. // animationDuration: 500
  49. // })
  50. // signingInitialization(qdOrderNo)
  51. // return
  52. request('fdfbdddba6ec49f8b451cf2e299b4feb', {
  53. data,
  54. }).then((res) => {
  55. if (res.statusCode === 0) {
  56. const data = JSON.parse(res.bizContent)
  57. if (data.status !== 0) {
  58. // 后台调用它方接口报错
  59. uni.showModal({
  60. title: '警告',
  61. content: data.msg,
  62. success: function(res) {}
  63. });
  64. return
  65. }
  66. if (data.signStatus === 1 && data.accountStatus === 1 && data.bindStatus === 1) {
  67. // 上面三值都为1才进行下一步,否则进行签约初始化
  68. uni.navigateTo({
  69. url: '/' + jumpPage,
  70. animationType: 'pop-in',
  71. animationDuration: 500
  72. })
  73. /* 自定义返回 */
  74. } else {
  75. // 进行签约初始化
  76. signingInitialization(qdOrderNo)
  77. }
  78. // qdOrderStore.orderInfo.value.orderId = JSON.parse(res.bizContent).orderId
  79. // 通过检测
  80. }
  81. })
  82. }
  83. // 签约初始化
  84. function signingInitialization(qdOrderNo) {
  85. const data = {
  86. qdOrderNo
  87. }
  88. request('94569071cf814517908cd35693f1f2e1', {
  89. data,
  90. }).then((res) => {
  91. if (res.statusCode === 0) {
  92. const data = JSON.parse(res.bizContent)
  93. if (data.status !== 0) {
  94. // 后台调用它方接口报错
  95. uni.showModal({
  96. title: '警告',
  97. content: data.msg,
  98. success: function(res) {}
  99. });
  100. return
  101. }
  102. if (data.returnType === 0) {
  103. // 0-无需跳转,关闭H5即可 1-需跳转至返回url
  104. // const opened = window.open('about:blank', '_self');
  105. // opened.opener = null;
  106. // opened.close();
  107. closeWin()
  108. } else {
  109. window.open(data.signUrl, '_self')
  110. }
  111. }
  112. })
  113. }
  114. </script>
  115. <!-- 签约管理 -->
  116. <style lang='scss' scoped>
  117. .sig-manage {
  118. height: 100vh;
  119. width: 100%;
  120. display: flex;
  121. justify-content: center;
  122. align-items: center;
  123. }
  124. </style>