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

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 wechatJsConfig = (data) => oahttp.get('/wechat/jsConfig', data)

View File

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

View File

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

View File

@ -6,13 +6,15 @@
<view class="login-card">
<view class="top">
<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>
<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="输入手机号" />
<view v-if="current==1" class="code item">
<input placeholder="输入验证码" v-model="formData.code"/>
<input placeholder="输入验证码" v-model="formData.code" />
<view class="get-code">获取验证码</view>
</view>
<view class="btn">
@ -36,15 +38,15 @@
account: 'admin123',
password: 'qq123456',
code: '',
terminal: 3,
terminal: 6, //6APP
scene: 1
}
};
},
methods: {
changeTabs(e){
changeTabs(e) {
this.current = e.index;
this.formData.scene = e.index+1;
this.formData.scene = e.index + 1;
},
async login() {
let that = this;
@ -56,7 +58,7 @@
token: res.data.token
})
uni.switchTab({
url:'/pages/oaHome/oaHome'
url: '/pages/oaHome/oaHome'
})
// uni.request({
// url: 'https://worker-task.lihaink.cn/api/login/account',
@ -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>
@ -159,7 +187,8 @@
display: flex;
justify-content: space-between;
align-items: center;
input{
input {
font-size: 28rpx;
}
@ -167,7 +196,8 @@
color: #3274F9;
}
}
.btn{
.btn {
display: flex;
justify-content: space-between;
}

View File

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

View File

@ -35,7 +35,7 @@
</template>
<script>
import {recharge, payWay, payPrepay} from "@/api/pay.js"
import {recharge, payWay, payPrepay, wechatJsConfig} from "@/api/pay.js"
export default {
data() {
return {
@ -62,7 +62,37 @@ export default {
order_id: data.order_id,
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() {