Merge branch 'develop' into dongjian

This commit is contained in:
2025-08-13 23:18:58 +08:00
6 changed files with 223 additions and 42 deletions
+4 -2
View File
@@ -64,7 +64,7 @@
}, },
methods: { methods: {
onCancel(){ onCancel(){
this.$emit('click'); this.$emit('cancel');
}, },
onOk(){ onOk(){
this.$emit('ok'); this.$emit('ok');
@@ -82,7 +82,9 @@
flex-direction: column; flex-direction: column;
background-color: rgba(0,0,0,0.3); background-color: rgba(0,0,0,0.3);
position: fixed; position: fixed;
z-index: 2000; left:0;
top:0;
z-index: 10000;
.down-panel{ .down-panel{
width:100%; width:100%;
height:764rpx; height:764rpx;
+1 -1
View File
@@ -124,5 +124,5 @@
"uniStatistics" : { "uniStatistics" : {
"enable" : false "enable" : false
}, },
"vueVersion" : "3" "vueVersion" : "2"
} }
+2 -1
View File
@@ -4,7 +4,7 @@
<Header title="查看合同" /> <Header title="查看合同" />
<view class="contract-view"> <view class="contract-view">
<view class="top-info flex-r-lr"> <view class="top-info flex-r-lr">
<image src="../../static/logo.png"></image> <image src="@/static/new/he.png"></image>
<view class="right-view"> <view class="right-view">
<text class="text-36 text-zu">消费型合伙人协议</text> <text class="text-36 text-zu">消费型合伙人协议</text>
<view class="bottom-panel"> <view class="bottom-panel">
@@ -32,6 +32,7 @@
</view> </view>
</view> </view>
</view> </view>
<up-toast ref="uToastRef"></up-toast>
</view> </view>
</template> </template>
+138 -10
View File
@@ -3,12 +3,16 @@
<TopSafe></TopSafe> <TopSafe></TopSafe>
<Header title="我的合同" /> <Header title="我的合同" />
<view class="contract-view"> <view class="contract-view">
<ContractItem :type="obj && obj.state" <ContractItem :type="type" :text="obj && obj.signatureName" :time="obj && obj.time" class="mt-24"
:text="obj && obj.signatureName" @click="onBtn"></ContractItem>
:time="obj && obj.time"
class="mt-24" @click="onBtn"></ContractItem>
</view> </view>
<DownPopup></DownPopup> <u-modal :show="tipsShow" :showCancelButton="true" confirmText="去认证"
@cancel="onTipsCancel" @confirm="onConfirm" confirmColor="#7934F6"
title="提示" content='签署合同需要进行实名认证,请先完成实名认证'></u-modal>
<DownPopup :show="downShow" @ok="onSignContract" @cancel="onCancel" />
<up-toast ref="uToastRef"></up-toast>
<!-- 腾讯电子签H5 → 集成到UniApp -->
<web-view v-if="signUrl" :src="signUrl" @message="handleMessage"></web-view>
</view> </view>
</template> </template>
@@ -19,6 +23,7 @@ import TopSafe from '@/components/common/top-safe.nvue'
import ContractItem from './components/contract-item.vue' import ContractItem from './components/contract-item.vue'
import DownPopup from '@/components/common/down-popup.vue'; import DownPopup from '@/components/common/down-popup.vue';
import { getContractList, signContract } from '@/api/contract.js' import { getContractList, signContract } from '@/api/contract.js'
import { getSignUrl, getMiniProgramSignUrl } from '@/api/order.js';
import func from '@/utils/func.js'; import func from '@/utils/func.js';
export default { export default {
@@ -26,21 +31,53 @@ export default {
data() { data() {
return { return {
type: false, type: false,
obj:null obj: null,
flowId: null,
signUrl: null,
downShow: false,
selectItem: null,
tipsShow:false,
userInfo:null
}; };
}, },
onShow() { onShow() {
},
onLoad(){
this.init(); this.init();
this.userinfo();
}, },
methods: { methods: {
init() { init() {
// this.isSignContract() this.isSignContract()
this.getSignContract()
},
userinfo(){
getUserInfo().then(res=>{
if(res.bizcode == 100){
this.userInfo = res.data;
}
console.log('res',res)
})
},
onConfirm(){
this.onTipsCancel();
uni.navigateTo({
url:'/pages/mine_package/mine_authentication/mine_authentication'
})
},
onTipsCancel(){
this.tipsShow =false;
},
onCancel(){
this.downShow = false;
}, },
isSignContract() { isSignContract() {
signContract().then(res => { signContract().then(res => {
if (res.bizcode == 100) { if (res.bizcode == 100) {
this.type = res.data; this.type = res.data;
if(this.type){
this.getSignContract()
}
} else { } else {
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: 'error', type: 'error',
@@ -51,7 +88,7 @@ export default {
}, },
getSignContract() { getSignContract() {
getContractList().then(res => { getContractList().then(res => {
if(res.bizcode == 100){ if (res.bizcode == 100 && res.data.length) {
this.obj = res.data[0]; this.obj = res.data[0];
this.obj.time = func.formatDate(new Date(res.data[0].signatureTime), 3) this.obj.time = func.formatDate(new Date(res.data[0].signatureTime), 3)
} else { } else {
@@ -70,8 +107,99 @@ export default {
}) })
} else { } else {
//去签署 //去签署
this.downShow = true;
} }
},
// 发起合同签章
async onSignContract() {
if(this.userInfo.certStatus == 0){
this.downShow = false;
this.tipsShow = true;
return;
}else if(this.userInfo.certStatus == 1){
this.downShow = false;
this.$refs.uToastRef.show({
type: 'success',
message: '请耐心等待审核通过',
});
return;
}
const params = {
// 需要的参数
orderId: this.selectItem.id,
}
const { bizcode, data } = await signContract(params);
if (bizcode === 100) {
this.flowId = data.flowId;
if (this.flowId)
// #ifdef APP-PLUS || WEB
this.onGetSignUrl(this.flowId);
// #endif
// #ifdef MP-WEIXIN
// 小程序
this.onGetMiniProgramSignUrl(this.flowId)
// #endif
}
},
// 获取H5签署链接
async onGetSignUrl(flowId) {
const params = {
// 需要的参数
flowId: flowId,
}
const { bizcode, data } = await getSignUrl(params);
if (bizcode === 100) {
this.signUrl = data.flowApproverUrlInfos[0].longUrl;
} else {
this.$refs.uToastRef.show({
type: 'error',
message: "获取签署链接失败,请稍后再试",
});
return null;
}
},
// 获取跳转至腾讯电子签小程序的签署链接
async onGetMiniProgramSignUrl(flowId) {
const params = {
flowId: flowId,
endPoint: 'HTTP_SHORT_URL'
}
const { bizcode, data } = await getMiniProgramSignUrl(params);
if (bizcode === 100) {
console.log("跳转至腾讯电子签小程序的签署链接", data);
this.openTencentESign(data.schemeUrl);
} else {
this.$refs.uToastRef.show({
type: 'error',
message: "获取签署链接失败,请稍后再试",
});
return null;
}
},
// 电子签的回调地址
handleMessage(e) {
const data = e.detail;
console.log('电子签的回调地址', e);
},
// 小程序签名
openTencentESign(signPath) {
// 这个链接需要后端调用腾讯电子签 API 获取
uni.navigateToMiniProgram({
appId: 'wxa023b292fd19d41d', // 腾讯电子签官方小程序的 appId
path: signPath, // 跳转到的页面路径 + 参数
extraData: {}, // 如果需要传额外参数
envVersion: 'release', // 小程序版本 release / trial / develop
success(res) {
console.log('跳转成功', res)
},
fail(err) {
console.error('跳转失败', err)
}
})
} }
} }
} }
+59 -9
View File
@@ -74,16 +74,12 @@
@click="jumpOrderInfo(item)">去付款</view> @click="jumpOrderInfo(item)">去付款</view>
<!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.COMPLETED">申请退款</view> --> <!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.COMPLETED">申请退款</view> -->
<view class="operate_comm operate_but_2" v-if="!isCheckSigne && item.status === ORDER_TYPE.NOT_RECEIVE" <view class="operate_comm operate_but_2" v-if="item.status === ORDER_TYPE.NOT_RECEIVE"
@click="onSignContract(item)">去签署
</view>
<view class="operate_comm operate_but_2" v-if="isCheckSigne && item.status === ORDER_TYPE.NOT_RECEIVE"
@click="confirmReceiptOk(item)">确认收货 @click="confirmReceiptOk(item)">确认收货
</view> </view>
<!-- <view class="operate_comm operate_but_3" v-if="item.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> --> <!-- <view class="operate_comm operate_but_3" v-if="item.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> -->
<view class="operate_comm operate_but_1" <view class="operate_comm operate_but_1"
v-if="[ORDER_TYPE.NOT_RECEIVE, ORDER_TYPE.UNSHIPPED].includes(item.status) && isCheckSigne" v-if="[ORDER_TYPE.NOT_RECEIVE, ORDER_TYPE.UNSHIPPED].includes(item.status)" @click="afterShow = true;">
@click="afterShow = true;">
申请售后 申请售后
</view> </view>
<!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.AFTER_SALE">查看售后</view> --> <!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.AFTER_SALE">查看售后</view> -->
@@ -193,17 +189,25 @@
<!-- 腾讯电子签H5 → 集成到UniApp --> <!-- 腾讯电子签H5 → 集成到UniApp -->
<web-view v-if="signUrl" :src="signUrl" @message="handleMessage"></web-view> <web-view v-if="signUrl" :src="signUrl" @message="handleMessage"></web-view>
<u-modal :show="tipsShow" :showCancelButton="true" confirmText="去认证"
@cancel="onTipsCancel" @confirm="onConfirm" confirmColor="#7934F6"
title="提示" content='签署合同需要进行实名认证,请先完成实名认证'></u-modal>
<DownPopup :show="downShow" @ok="onSignContract" @cancel="onCancel" />
</view> </view>
</template> </template>
<script> <script>
import { MINE_ORDER_TYPE, ORDER_TYPE, ORDER_STATUS, getValue } from '@/utils/enumUtils.js'; import { MINE_ORDER_TYPE, ORDER_TYPE, ORDER_STATUS, getValue } from '@/utils/enumUtils.js';
import { ORDER_STATUS_CSS } from '@/utils/enumCssUtils.js'; import { ORDER_STATUS_CSS } from '@/utils/enumCssUtils.js';
import DownPopup from '@/components/common/down-popup.vue'
import { getOrderList, confirmReceipt, getSignUrl, signContract, isSignContract, getMiniProgramSignUrl } from '@/api/order.js'; import { getOrderList, confirmReceipt, getSignUrl, signContract, isSignContract, getMiniProgramSignUrl } from '@/api/order.js';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { formatDate1, copyData } from '@/utils/index.js' import { formatDate1, copyData } from '@/utils/index.js'
import {getUserInfo} from '@/api/auth.js'
export default { export default {
components: { DownPopup },
computed: { computed: {
MINE_ORDER_TYPE() { MINE_ORDER_TYPE() {
return MINE_ORDER_TYPE; return MINE_ORDER_TYPE;
@@ -278,7 +282,11 @@ export default {
afterShow: false,// 售后申请 afterShow: false,// 售后申请
isCheckSigne: false, isCheckSigne: false,
flowId: null, flowId: null,
signUrl: null signUrl: null,
downShow: false,
selectItem: null,
userInfo:null
} }
}, },
onLoad(options) { onLoad(options) {
@@ -289,12 +297,33 @@ export default {
if (this.form.type === MINE_ORDER_TYPE.NOT_RECEIVE) { if (this.form.type === MINE_ORDER_TYPE.NOT_RECEIVE) {
this.checkSigned(); this.checkSigned();
} }
this.userinfo();
}, },
methods: { methods: {
dayjs, dayjs,
getValue, getValue,
formatDate1, formatDate1,
copyData, copyData,
onTipsCancel(){
this.tipsShow =false;
},
userinfo(){
getUserInfo().then(res=>{
if(res.bizcode == 100){
this.userInfo = res.data;
}
console.log('res',res)
})
},
onCancel(){
this.downShow = false;
},
onConfirm(){
this.onTipsCancel();
uni.navigateTo({
url:'/pages/mine_package/mine_authentication/mine_authentication'
})
},
copyMobile(mobile) { copyMobile(mobile) {
copyData(mobile); copyData(mobile);
this.afterShow = false; this.afterShow = false;
@@ -410,6 +439,13 @@ export default {
*/ */
confirmReceiptOk(item) { confirmReceiptOk(item) {
const then = this; const then = this;
if (!this.isCheckSigne) {
this.selectItem = item;
this.downShow = true;
return;
}
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '是否确认收货?', content: '是否确认收货?',
@@ -441,10 +477,23 @@ export default {
}, },
// 发起合同签章 // 发起合同签章
async onSignContract(item) { async onSignContract() {
if(this.userInfo.certStatus == 0){
this.downShow = false;
this.tipsShow = true;
return;
}else if(this.userInfo.certStatus == 1){
this.downShow = false;
this.$refs.uToastRef.show({
type: 'success',
message: '请耐心等待审核通过',
});
return;
}
const params = { const params = {
// 需要的参数 // 需要的参数
orderId: item.id, orderId: this.selectItem.id,
} }
const { bizcode, data } = await signContract(params); const { bizcode, data } = await signContract(params);
if (bizcode === 100) { if (bizcode === 100) {
@@ -531,6 +580,7 @@ export default {
background-color: $app-bj; background-color: $app-bj;
padding: 100rpx 30rpx 30rpx; padding: 100rpx 30rpx 30rpx;
overflow-y: hidden; overflow-y: hidden;
position: relative;
} }
.order_header { .order_header {
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB