147 lines
3.3 KiB
Vue
147 lines
3.3 KiB
Vue
<template>
|
|
<view class="content">
|
|
<TopSafe></TopSafe>
|
|
<Header title="我的合同" />
|
|
<view class="contract-view">
|
|
<ContractItem :type="type"
|
|
:text="obj && obj.signatureName"
|
|
:time="obj && obj.time"
|
|
class="mt-24" @click="onBtn"></ContractItem>
|
|
</view>
|
|
<DownPopup></DownPopup>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { getUserInfo } from '@/api/auth.js';
|
|
import Header from '@/components/common/header.vue';
|
|
import TopSafe from '@/components/common/top-safe.nvue'
|
|
import ContractItem from './components/contract-item.vue'
|
|
import DownPopup from '@/components/common/down-popup.vue';
|
|
import { getContractList,signContract } from '@/api/contract.js'
|
|
import func from '@/utils/func.js';
|
|
|
|
export default {
|
|
components: { Header,TopSafe,ContractItem,DownPopup },
|
|
data() {
|
|
return {
|
|
type:false,
|
|
obj:null
|
|
};
|
|
},
|
|
onShow() {
|
|
this.init();
|
|
},
|
|
methods: {
|
|
init(){
|
|
this.isSignContract()
|
|
this.getSignContract()
|
|
},
|
|
isSignContract(){
|
|
signContract().then(res=>{
|
|
if(res.bizcode == 100){
|
|
this.type = res.data;
|
|
}else{
|
|
this.$refs.uToastRef.show({
|
|
type: 'error',
|
|
message: res.msg,
|
|
});
|
|
}
|
|
})
|
|
},
|
|
getSignContract(){
|
|
getContractList().then(res=>{
|
|
if(res.bizcode == 100){
|
|
this.obj = res.data[0];
|
|
this.obj.time = func.formatDate(new Date(res.data[0].signatureTime),3)
|
|
}else{
|
|
this.$refs.uToastRef.show({
|
|
type: 'error',
|
|
message: res.msg,
|
|
});
|
|
}
|
|
})
|
|
},
|
|
onBtn(){
|
|
if(this.type){
|
|
//查看
|
|
uni.navigateTo({
|
|
url:`/pages/contract/check`
|
|
})
|
|
}else{
|
|
//去签署
|
|
|
|
}
|
|
},
|
|
// 查询用户等级
|
|
async getUserInfo() {
|
|
const result = await getUserInfo();
|
|
if (result && result.bizcode === 100) {
|
|
const data = result.data;
|
|
this.userData = result.data || {};
|
|
}
|
|
},
|
|
// 退出登录
|
|
loginOutFun() {
|
|
clear();
|
|
uni.navigateTo({
|
|
url: '/pages/login_package/login/login'
|
|
})
|
|
},
|
|
cancelAccount() {
|
|
clear();
|
|
uni.navigateTo({
|
|
url: '/pages/login_package/login/login'
|
|
})
|
|
},
|
|
jumpInfo(type) {
|
|
// 地址
|
|
if (type === "address") {
|
|
uni.navigateTo({
|
|
url: '/pages/mine_package/mine_address/mine_address'
|
|
})
|
|
} else if (type === "aboutUs") {
|
|
uni.navigateTo({
|
|
url: '/pages/mine_package/mine_about_us/mine_about_us'
|
|
})
|
|
} else if (type === "userAgreement") {// 用户协议
|
|
uni.navigateTo({
|
|
url: '/pages/mine_package/mine_user_agreement/mine_user_agreement'
|
|
})
|
|
} else if (type === "privacyAgreement") {// 隐私政策
|
|
uni.navigateTo({
|
|
url: '/pages/mine_package/mine_privacy_agreement/mine_privacy_agreement'
|
|
})
|
|
} else if (type === "productAgreement") {// 售后保障协议
|
|
uni.navigateTo({
|
|
url: '/pages/mine_package/mine_product_agreement/mine_product_agreement'
|
|
})
|
|
}else if(type === 'contract'){
|
|
uni.navigateTo({
|
|
url:'/pages/contract/index'
|
|
})
|
|
}
|
|
},
|
|
// 跳转到交易密码
|
|
jumpPwd() {
|
|
uni.navigateTo({
|
|
url: '/pages/mine_package/mine_transaction_password/mine_transaction_password'
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.contract-view{
|
|
width:100%;
|
|
height:calc(100% - 88rpx - var(--status-bar-height));
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
overflow-y: auto;
|
|
padding: 0 32rpx;
|
|
box-sizing: border-box;
|
|
}
|
|
</style>
|