123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <template>
- </template>
- <script setup lang='ts'>
- import {
- ref
- } from 'vue'
- import {
- unifyTemplate
- } from '@/hooks/unifyTemplate'
- import {
- onLoad
- } from '@dcloudio/uni-app';
- import {
- request
- } from '@/utils/network/request'
- const {
- initData, //初始化数据
- qdOrderVal //qdOrder中数据 ref
- } = unifyTemplate() //初始化数据
- //获取页面配置
- onLoad((opin) => {
- initData(opin, 3).then(data => {
- // contractTesting(data.qdOrder.qdOrderNo, data.config.jumpPage)
- contractQuery(data.qdOrder.qdOrderNo, data.config.jumpPage,data)
- })
- })
-
- // 合同查询
- function contractQuery(qdOrderNo, jumpPage,orderData) {
- const data = {
- orderId: qdOrderVal.value.qtOrderNo //订单id
- }
- request('7e039f28efcb4ff6ae7e3a2111339b87', {
- data,
- }).then((res) => {
- if (res.statusCode === 0) {
- const data = JSON.parse(res.bizContent)
- if (data.signmentState !== 1 || data.contractState !== 1) {
- // 合同处理
- handleContract(orderData)
- } else {
- uni.navigateTo({
- url: '/' + jumpPage,
- animationType: 'pop-in',
- animationDuration: 500
- })
- // 都为1说明可以进行签约检测
- // contractTesting(qdOrderNo, jumpPage)
- }
- }
- })
- }
- // 合同处理
- function handleContract(orderData) {
- console.log(qdOrderVal.value);
- let ifCode: any
- if (orderData.order.userType === 'PERSONAL_USER') {
- // 个人合同
- ifCode = 'ec36c36b501341b19407990265a36313'
- } else {
- ifCode = 'b808a5b65cec4fe4b4a873874f9541e8 '
- }
- const data = {
- orderId: qdOrderVal.value.qtOrderNo //订单id
- }
- request(ifCode, {
- data,
- }).then((res) => {
- if (res.statusCode === 0) {
- const data = JSON.parse(res.bizContent)
- window.open(data.shortUrl, '_self')
- }
- })
- }
-
- // // 签约检测
- // function contractTesting(qdOrderNo, jumpPage) {
- // const data = {
- // qdOrderNo,
- // }
- // request('fdfbdddba6ec49f8b451cf2e299b4feb', {
- // data,
- // }).then((res) => {
- // if (res.statusCode === 0) {
- // const data = JSON.parse(res.bizContent)
- // if (data.status !== 0) {
- // // 后台调用它方接口报错
- // uni.showModal({
- // title: '警告',
- // content: data.msg,
- // success: function(res) {}
- // });
- // return
- // }
- // if (data.signStatus === 1 && data.accountStatus === 1 && data.bindStatus === 1) {
- // // 上面三值都为1才进行下一步,否则进行签约初始化
- // uni.navigateTo({
- // url: '/' + jumpPage,
- // animationType: 'pop-in',
- // animationDuration: 500
- // })
- // /* 自定义返回 */
- // } else {
- // // 进行签约初始化
- // signingInitialization(qdOrderNo)
- // }
- // // qdOrderStore.orderInfo.value.orderId = JSON.parse(res.bizContent).orderId
- // // 通过检测
- // }
- // })
- // }
- // // 签约初始化
- // function signingInitialization(qdOrderNo) {
- // const data = {
- // qdOrderNo
- // }
- // request('94569071cf814517908cd35693f1f2e1', {
- // data,
- // }).then((res) => {
- // if (res.statusCode === 0) {
- // const data = JSON.parse(res.bizContent)
- // if (data.status !== 0) {
- // // 后台调用它方接口报错
- // uni.showModal({
- // title: '警告',
- // content: data.msg,
- // success: function(res) {}
- // });
- // return
- // }
- // if (data.returnType === 0) {
- // // 0-无需跳转,关闭H5即可 1-需跳转至返回url
- // // const opened = window.open('about:blank', '_self');
- // // opened.opener = null;
- // // opened.close();
- // closeWin()
- // } else {
- // window.open(data.signUrl, '_self')
- // }
- // }
- // })
- // }
- // // 关闭当前页面方法
- // function closeWin() {
- // // @ts-ignore
- // var jWeixin = import('jweixin-module')
- // // @ts-ignore
- // jWeixin.miniProgram.getEnv(function(res) {
- // if (res.miniprogram) {
- // // @ts-ignore
- // jWeixin.miniProgram.navigateTo({
- // url: '/path/to/page'
- // })
- // } else {
- // const opened = window.open('about:blank', '_self');
- // opened.opener = null;
- // opened.close()
- // }
- // })
- // }
- </script>
- <!-- 签约管理 -->
- <style lang='scss' scoped>
- .sig-manage {
- height: 100vh;
- width: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- </style>
|