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

sigManage - 副本 (2).vue 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. </template>
  3. <script setup lang='ts'>
  4. import {
  5. ref
  6. } from 'vue'
  7. import {
  8. unifyTemplate
  9. } from '@/hooks/unifyTemplate'
  10. import {
  11. onLoad
  12. } from '@dcloudio/uni-app';
  13. import {
  14. request
  15. } from '@/utils/network/request'
  16. const {
  17. initData, //初始化数据
  18. qdOrderVal //qdOrder中数据 ref
  19. } = unifyTemplate() //初始化数据
  20. //获取页面配置
  21. onLoad((opin) => {
  22. initData(opin, 3).then(data => {
  23. // contractTesting(data.qdOrder.qdOrderNo, data.config.jumpPage)
  24. contractQuery(data.qdOrder.qdOrderNo, data.config.jumpPage,data)
  25. })
  26. })
  27. // 合同查询
  28. function contractQuery(qdOrderNo, jumpPage,orderData) {
  29. const data = {
  30. orderId: qdOrderVal.value.qtOrderNo //订单id
  31. }
  32. request('7e039f28efcb4ff6ae7e3a2111339b87', {
  33. data,
  34. }).then((res) => {
  35. if (res.statusCode === 0) {
  36. const data = JSON.parse(res.bizContent)
  37. if (data.signmentState !== 1 || data.contractState !== 1) {
  38. // 合同处理
  39. handleContract(orderData)
  40. } else {
  41. uni.navigateTo({
  42. url: '/' + jumpPage,
  43. animationType: 'pop-in',
  44. animationDuration: 500
  45. })
  46. // 都为1说明可以进行签约检测
  47. // contractTesting(qdOrderNo, jumpPage)
  48. }
  49. }
  50. })
  51. }
  52. // 合同处理
  53. function handleContract(orderData) {
  54. console.log(qdOrderVal.value);
  55. let ifCode: any
  56. if (orderData.order.userType === 'PERSONAL_USER') {
  57. // 个人合同
  58. ifCode = 'ec36c36b501341b19407990265a36313'
  59. } else {
  60. ifCode = 'b808a5b65cec4fe4b4a873874f9541e8 '
  61. }
  62. const data = {
  63. orderId: qdOrderVal.value.qtOrderNo //订单id
  64. }
  65. request(ifCode, {
  66. data,
  67. }).then((res) => {
  68. if (res.statusCode === 0) {
  69. const data = JSON.parse(res.bizContent)
  70. window.open(data.shortUrl, '_self')
  71. }
  72. })
  73. }
  74. // // 签约检测
  75. // function contractTesting(qdOrderNo, jumpPage) {
  76. // const data = {
  77. // qdOrderNo,
  78. // }
  79. // request('fdfbdddba6ec49f8b451cf2e299b4feb', {
  80. // data,
  81. // }).then((res) => {
  82. // if (res.statusCode === 0) {
  83. // const data = JSON.parse(res.bizContent)
  84. // if (data.status !== 0) {
  85. // // 后台调用它方接口报错
  86. // uni.showModal({
  87. // title: '警告',
  88. // content: data.msg,
  89. // success: function(res) {}
  90. // });
  91. // return
  92. // }
  93. // if (data.signStatus === 1 && data.accountStatus === 1 && data.bindStatus === 1) {
  94. // // 上面三值都为1才进行下一步,否则进行签约初始化
  95. // uni.navigateTo({
  96. // url: '/' + jumpPage,
  97. // animationType: 'pop-in',
  98. // animationDuration: 500
  99. // })
  100. // /* 自定义返回 */
  101. // } else {
  102. // // 进行签约初始化
  103. // signingInitialization(qdOrderNo)
  104. // }
  105. // // qdOrderStore.orderInfo.value.orderId = JSON.parse(res.bizContent).orderId
  106. // // 通过检测
  107. // }
  108. // })
  109. // }
  110. // // 签约初始化
  111. // function signingInitialization(qdOrderNo) {
  112. // const data = {
  113. // qdOrderNo
  114. // }
  115. // request('94569071cf814517908cd35693f1f2e1', {
  116. // data,
  117. // }).then((res) => {
  118. // if (res.statusCode === 0) {
  119. // const data = JSON.parse(res.bizContent)
  120. // if (data.status !== 0) {
  121. // // 后台调用它方接口报错
  122. // uni.showModal({
  123. // title: '警告',
  124. // content: data.msg,
  125. // success: function(res) {}
  126. // });
  127. // return
  128. // }
  129. // if (data.returnType === 0) {
  130. // // 0-无需跳转,关闭H5即可 1-需跳转至返回url
  131. // // const opened = window.open('about:blank', '_self');
  132. // // opened.opener = null;
  133. // // opened.close();
  134. // closeWin()
  135. // } else {
  136. // window.open(data.signUrl, '_self')
  137. // }
  138. // }
  139. // })
  140. // }
  141. // // 关闭当前页面方法
  142. // function closeWin() {
  143. // // @ts-ignore
  144. // var jWeixin = import('jweixin-module')
  145. // // @ts-ignore
  146. // jWeixin.miniProgram.getEnv(function(res) {
  147. // if (res.miniprogram) {
  148. // // @ts-ignore
  149. // jWeixin.miniProgram.navigateTo({
  150. // url: '/path/to/page'
  151. // })
  152. // } else {
  153. // const opened = window.open('about:blank', '_self');
  154. // opened.opener = null;
  155. // opened.close()
  156. // }
  157. // })
  158. // }
  159. </script>
  160. <!-- 签约管理 -->
  161. <style lang='scss' scoped>
  162. .sig-manage {
  163. height: 100vh;
  164. width: 100%;
  165. display: flex;
  166. justify-content: center;
  167. align-items: center;
  168. }
  169. </style>