修改支付功能,优化合同详情

This commit is contained in:
weipengfei 2023-07-19 18:51:31 +08:00
parent e00ab69248
commit 289e9fd9d6
6 changed files with 101 additions and 16 deletions

View File

@ -15,5 +15,8 @@ export const payWay = (data) => oahttp.get('/pay/payWay', data)
*/ */
export const payPrepay = (data) => oahttp.post('/pay/prepay', data) export const payPrepay = (data) => oahttp.post('/pay/prepay', data)
/**
* 支付配置
*/
export const wechatJsConfig = (data) => oahttp.get('/wechat/jsConfig', data)

View File

@ -44,7 +44,9 @@
] ]
}, },
/* ios */ /* ios */
"ios" : {}, "ios" : {
"dSYMs" : false
},
/* SDK */ /* SDK */
"sdkConfigs" : { "sdkConfigs" : {
"payment" : { "payment" : {
@ -53,7 +55,8 @@
"appid" : "__UNI__3A527D1", "appid" : "__UNI__3A527D1",
"UniversalLinks" : "" "UniversalLinks" : ""
} }
} },
"ad" : {}
} }
} }
}, },

View File

@ -134,6 +134,24 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}
,{
"path" : "contract/contract",
"style" :
{
"navigationBarTitleText": "合同签订",
"enablePullDownRefresh": false
}
}
,{
"path" : "contractDetail/contractDetail",
"style" :
{
"navigationBarTitleText": "合同详情",
"enablePullDownRefresh": false
}
} }
] ]
}], }],

View File

@ -6,10 +6,12 @@
<view class="login-card"> <view class="login-card">
<view class="top"> <view class="top">
<view class="text item"> <view class="text item">
<u-tabs :list="[{name:'账号登录'},{name:'手机登录'}]" @click="changeTabs" lineColor="#3274F9" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;font-size: 32rpx;"></u-tabs> <u-tabs :list="[{name:'账号登录'},{name:'手机登录'}]" @click="changeTabs" lineColor="#3274F9"
itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;font-size: 32rpx;"></u-tabs>
</view> </view>
<input v-if="current==0" class="mobile item" v-model="formData.account" placeholder="输入账号" /> <input v-if="current==0" class="mobile item" v-model="formData.account" placeholder="输入账号" />
<input v-if="current==0" class="mobile item" v-model="formData.password" placeholder="输入密码" password type="safe-password"/> <input v-if="current==0" class="mobile item" v-model="formData.password" placeholder="输入密码" password
type="safe-password" />
<input v-if="current==1" class="mobile item" v-model="formData.account" placeholder="输入手机号" /> <input v-if="current==1" class="mobile item" v-model="formData.account" placeholder="输入手机号" />
<view v-if="current==1" class="code item"> <view v-if="current==1" class="code item">
<input placeholder="输入验证码" v-model="formData.code" /> <input placeholder="输入验证码" v-model="formData.code" />
@ -36,7 +38,7 @@
account: 'admin123', account: 'admin123',
password: 'qq123456', password: 'qq123456',
code: '', code: '',
terminal: 3, terminal: 6, //6APP
scene: 1 scene: 1
} }
}; };
@ -73,8 +75,34 @@
// } // }
// }) // })
},
initTerminal() {
// #ifndef APP-PLUS
this.formData.terminal = 6;
// #endif
uni.getSystemInfo({
success: (res) => {
const platform = res.platform.toLowerCase();
if (platform === 'ios') {
this.formData.terminal = 5;
} else if (platform === 'windows') {
this.formData.terminal = 4;
} else if (platform === 'mac') {
this.formData.terminal = 4;
} }
} }
})
// #ifdef H5
this.formData.terminal = 3;
// #endif
// #ifdef MP-WEIXIN
this.formData.terminal = 1;
// #endif
}
},
mounted() {
this.initTerminal();
}
} }
</script> </script>
@ -159,6 +187,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
input { input {
font-size: 28rpx; font-size: 28rpx;
} }
@ -167,6 +196,7 @@
color: #3274F9; color: #3274F9;
} }
} }
.btn { .btn {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@ -204,7 +204,8 @@ export const oaHomeData = [
}, },
{ {
text: '合同签订', text: '合同签订',
icon: prefix + 'oa/cgsq@2x.png' icon: prefix + 'oa/cgsq@2x.png',
url: '/subpkg/contract/contract'
}, },
{ {
text: '公司管理', text: '公司管理',

View File

@ -35,7 +35,7 @@
</template> </template>
<script> <script>
import {recharge, payWay, payPrepay} from "@/api/pay.js" import {recharge, payWay, payPrepay, wechatJsConfig} from "@/api/pay.js"
export default { export default {
data() { data() {
return { return {
@ -62,7 +62,37 @@ export default {
order_id: data.order_id, order_id: data.order_id,
pay_way: res.data.lists[0].pay_way pay_way: res.data.lists[0].pay_way
}) })
console.log(res1); console.log(res1.data, res1.data.config.package.split('=')[1]);
let obj = {
"appid": res1.data.config.appId, // - - AppId AppId
"noncestr": res1.data.config.nonceStr, //
"package": res1.data.config.package, //
"partnerid": res1.data.config.partnerid, //
"prepayid": res1.data.config.package.split('=')[1], //
"timestamp": res1.data.config.timestamp, //
"sign": res1.data.config.paySign
}
console.log(obj);
uni.getProvider({
service:'payment',
success: (paymentList) => {
// console.log(paymentList);
uni.requestPayment({
provider: 'wxpay',
// orderInfo: res1.data.config,
orderInfo: obj,
success: (e) => {
console.log('成功', e);
},
fail: (e) => {
console.log('error', e);
},
complete: () => {
},
});
}
})
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {