1、修复签约宝问题

2、其他调整
This commit is contained in:
2023-12-05 22:37:53 +08:00
parent b7d83b0dae
commit 1a47dc1b54
19 changed files with 470 additions and 84 deletions
+1 -1
View File
@@ -48,7 +48,7 @@
</a>
</li>
<li class="side-steel-search">
<a rel="nofollow" href="javascript:;" @click="navTo('/pages/yellowPage/list')">
<a rel="nofollow" href="javascript:;" @click="navTo('/pages/contract/index?tab=sign')">
<div class="item">
<agreement theme="outline" size="16" fill="#666" strokeLinecap="square"/>
</div>
+6 -7
View File
@@ -28,15 +28,16 @@
<el-dropdown-item>
<navigator url="/pages/user/school">金久信学堂</navigator>
</el-dropdown-item>
<el-dropdown-item command="contract">合同管理</el-dropdown-item>
<el-dropdown-item>
<navigator url="/pages/contract/index">合同管理</navigator>
</el-dropdown-item>
<el-dropdown-item>
<navigator url="/pages/contract/index?tab=sign">签约宝</navigator>
</el-dropdown-item>
<el-dropdown-item>订单管理</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<div class="mod-tools">
@@ -106,8 +107,6 @@
handleCommand(e) {
if (e == 'logout') {
this.logout()
}else if(e == 'contract') {
vk.navigateTo('/pages/contract/index');
}
},
logout() {
+8
View File
@@ -280,6 +280,14 @@
"navigationBarTitleText" : "金久信学堂",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/index/shop/pay",
"style" :
{
"navigationBarTitleText" : "订单支付",
"enablePullDownRefresh" : false
}
}
],
"globalStyle": {
+11 -2
View File
@@ -372,8 +372,17 @@ export default {
// 表单相关结束-----------------------------------------------------------
}
},
onLoad() {
this.query(1)
onLoad(options) {
if (options.tab) {
if (options.tab === 'sign') {
this.isSign = true
} else {
this.menuIndex = String(options.tab)
this.formData.status = Number(options.tab)
this.isSign = false
this.query(1)
}
}
},
methods: {
menuSelect(e) {
+12 -1
View File
@@ -90,7 +90,7 @@
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary"
<el-button type="primary" @click="newOrder"
:disabled="contentList.length === 0 || companyList.length === 0 || !companyList[0].name">
立即支付
</el-button>
@@ -172,6 +172,17 @@ export default {
},
removeCompany() {
this.companyList.splice(index, 1)
},
async newOrder(){
const {data} = await vk.callFunction({
url: 'client/order/kh/addFromList',
data: {
type: 1,
list: [
]
}
})
}
},
onLoad() {
+16 -1
View File
@@ -32,7 +32,7 @@
</view>
<view class="flex justify-end is-center">
<el-button type="danger" round class="add-to-cart-btn" @click.native="addToCart">加入购物车</el-button>
<el-button type="primary" round class="ml-35">立即购买</el-button>
<el-button type="primary" round class="ml-35" @click.native="newOrder">立即购买</el-button>
</view>
</view>
</view>
@@ -45,6 +45,8 @@
<!-- 现货市场 end -->
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
</view>
</template>
@@ -90,6 +92,19 @@ export default {
})
}
})
},
async newOrder(){
const {data} = await vk.callFunction({
url: 'client/order/kh/add',
data: {
goodsId: this.id,
num: 1,
type: 0
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
}
}
+180
View File
@@ -0,0 +1,180 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a bg-white p-40">
<template v-if="info">
<view class="pb-20 border-bottom flex justify-between items-center">
<text>订单号: {{ info.orderNo }}</text>
<text>下单时间: {{ info._add_time_str }}</text>
</view>
<view class="my-20">
<text class="font-bold text-35">商品详情</text>
<view class="flex justify-start items-start my-20">
<text class="w-15p">封面</text>
<text class="w-40p">名称</text>
<text class="w-15p">数量</text>
<text class="w-15p">单价</text>
<text class="w-15p">小计</text>
</view>
<view class="flex justify-start items-start my-20" v-for="(item, index) in info.goods">
<text class="w-15p">
<image :src="item.goodsCover" mode="aspectFit" class="goods-cover"/>
</text>
<text class="w-40p font-bold text-35">{{ item.goodsName }}</text>
<text class="w-15p">x{{ item.num }}</text>
<text class="w-15p text-main">¥{{ item.goodsPrice }}</text>
<text class="w-15p">{{ item.goodsPrice * item.num }}</text>
</view>
</view>
</template>
<el-row :gutter="10" class="mb-20">
<el-col :span="4">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-col>
<el-col :span="4">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</el-col>
</el-row>
<el-row :gutter="10" class="border-bottom pb-20">
<el-col :span="4">
<el-select v-model="addressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[1]" placeholder="请选择市" :disabled="addressIndex.length === 0">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区" :disabled="addressIndex.length === 1">
<template v-if="addressIndex[0] !== null && addressIndex[1] !== null">
<el-option v-for="(item, index) in areaData[addressIndex[0]][addressIndex[1]]" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="12">
<el-input v-model="addressDetail" placeholder="请输入详细地址"/>
</el-col>
</el-row>
<view class="mt-20 w-50p flex flex-col justify-center items-center m-a">
<text class="text-main font-bold text-40 mb-20">订单金额:¥{{ info.amount }}</text>
<el-button type="primary" round :disabled="!phone || !name || addressIndex.length < 3" @click="onPay">立即支付</el-button>
</view>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
</view>
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import dayjs from "dayjs";
const OpenSdk = require('../../user/lib/base').default;
const sdk = new OpenSdk({
appId: '10037e6f6823b20801682b6a5e5a0006',
appKey: '1c4e3b16066244ae9b236a09e5b312e8'
})
export default {
name: "order",
data() {
return {
id: null,
info: null,
provinceData: provinces,
cityData: citys,
areaData: areas,
addressIndex: [null, null, null],
addressDetail: '',
name: '',
phone: '',
billQRCode: null
}
},
methods: {
async getInfo() {
this.info = await vk.callFunction({
url: 'client/order/kh/getInfo',
data: {
id: this.id
}
})
},
onPay() {
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYmmddHHmmSS')
console.log(timestamp)
console.log(requestTimestamp)
let data = {
queryUrl: 'https://test-api-open.chinaums.com/v1/netpay/bills/get-qrcode',
timestamp,
nonce: 'rp84ufhfn20yneo3tp',
content: {
requestTimestamp,
mid: '898201612345678',
tid: '88880001',
instMid: 'QRPAYDEFAULT',
totalAmount: 1,
notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/'
}
}
/**
* 调用函数
*/
sdk.exec(data).then(res => {
const h = this.$createElement;
const result = JSON.parse(res);
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
}
})
},
},
onLoad(options) {
if (options && options.id) {
this.id = options.id
this.getInfo()
}
}
}
</script>
<style lang="scss" scoped>
.goods-cover {
width: 100px;
height: 100px;
}
.pay-price {
margin-top: 20px;
}
.pay-desc {
font-size: 16px;
line-height: 2em;
}
</style>
+17 -12
View File
@@ -22,20 +22,22 @@
</view>
<view class="goods-list">
<el-row class="wrap" type="flex" :gutter="10" justify="space-between">
<el-col :span="4" v-for="(item, index) in goodsList" :key="index">
<div class="grid-content bg-purple pointer"
@click="navTo(`/pages/index/shop/detail?id=${item._id}`)">
<image :src="item.cover" mode="aspectFill"/>
<view class="comments">
<view class="goods-name">
{{ item.name }}
<view class="flex flex-wrap justify-start is-status">
<view class="w-20p" v-for="(item, index) in goodsList" :key="index">
<view class="p-20">
<view class="grid-content bg-purple pointer"
@click="navTo(`/pages/index/shop/detail?id=${item._id}`)">
<image :src="item.cover" mode="aspectFill"/>
<view class="comments">
<view class="goods-name">
{{ item.name }}
</view>
<view class="goods-price">¥{{ item.amount }}</view>
</view>
<view class="goods-price">¥{{ item.amount }}</view>
</view>
</div>
</el-col>
</el-row>
</view>
</view>
</view>
<div class="pagination">
<el-pagination
background
@@ -167,6 +169,7 @@ export default {
.grid-content {
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
width: 100%;
padding: 10px;
@@ -177,7 +180,9 @@ export default {
display: flex;
flex-direction: column;
justify-content: start;
align-items: flex-start;
line-height: 2em;
width: 100%;
.goods-name {
font-size: 16px;
+3 -2
View File
@@ -53,6 +53,7 @@
<script>
import UQRCode from 'uqrcodejs';
import dayjs from "dayjs";
const OpenSdk = require('../lib/base').default;
// const OpenSdk = require('ums-sdk-nodejs').default;
@@ -180,8 +181,8 @@ export default {
},
onPay() {
const date = new Date()
const requestTimestamp = this.dateFormat('YYYY-mm-dd HH:MM:SS', date)
const timestamp = this.dateFormat('YYYYmmddHHMMSS', date)
const requestTimestamp = dayjs(date).format('YYYY-MM-DD HH:MM:ss')
const timestamp = dayjs(date).format('YYYYmmddHHmmSS')
console.log(timestamp)
console.log(requestTimestamp)
let data = {
+27 -26
View File
@@ -17,10 +17,12 @@
<view class="mt-40 bg-white company">
<view class="p-50 flex justify-between items-center pb-30 border-bottom">
<view class="flex justify-start items-center">
<image class="logo" :src="info.businessCard.logo"/>
<image class="logo" :src="info.businessCard.logo" v-if="info.businessCard"/>
<view class="ml-35 flex flex-col justify-start items-start">
<text class="text-40 font-bold">{{ info.company.companyName }}</text>
<text class="text-gray text-28 mt-40">主营业务: {{ info.businessCard.mainBusiness }}</text>
<text class="text-gray text-28 mt-40" v-if="info.businessCard">主营业务:
{{ info.businessCard.mainBusiness }}
</text>
</view>
</view>
<view class="flex justify-end items-center">
@@ -50,23 +52,23 @@
<view class="mt-20 flex justify-start items-start flex-wrap w-100p text-30">
<view class="flex justify-start items-center w-33p mb-20">
<i class="el-icon-map-location mr-15"/>
<text>地址:{{ info.manager.address }}</text>
<text v-if="info.manager">地址:{{ info.manager.address }}</text>
</view>
<view class="flex justify-start items-center w-33p mb-20">
<i class="el-icon-phone mr-15"/>
<text>电话:{{ info.businessCard.phone }}</text>
<text v-if="info.businessCard">电话:{{ info.businessCard.phone }}</text>
</view>
<view class="flex justify-start items-center w-33p mb-20">
<i class="el-icon-mobile mr-15"/>
<text>手机:{{ info.businessCard.mobile }}</text>
<text v-if="info.businessCard">手机:{{ info.businessCard.mobile }}</text>
</view>
<view class="flex justify-start items-center w-33p">
<i class="el-icon-message mr-15"/>
<text>邮箱:{{ info.businessCard.email }}</text>
<text v-if="info.businessCard">邮箱:{{ info.businessCard.email }}</text>
</view>
<view class="flex justify-start items-center w-33p">
<i class="el-icon-data-board mr-15"/>
<text>网址:{{ info.businessCard.website }}</text>
<text v-if="info.businessCard">网址:{{ info.businessCard.website }}</text>
</view>
</view>
</view>
@@ -98,7 +100,8 @@
</view>
<view class="flex justify-between items-start mb-20">
<view class="title">发布的询价单</view>
<view class="text-main pointer" @click="vk.navigateTo('/pages/spot/goods/goods')">查看更多></view>
<view class="text-main pointer" @click="vk.navigateTo('/pages/spot/goods/goods')">查看更多>
</view>
</view>
<view class="bg-gray-light flex justify-center items-center table-header p-20">
<view class="text-gray flex-1">品名/材质</view>
@@ -111,20 +114,22 @@
</view>
<view class="flex justify-center items-center mt-20 w-100p p-20"
v-for="(item, index) in info.enquiryList" :key="index">
<view class="text-main flex-1">{{ item.productList[0].goodsName }}</view>
<view class="flex-1">{{ item.productList[0].procureNumber }}{{
item.productList[0].procureUnit
}}
</view>
<view class="flex-1">{{ item.address }}</view>
<view class="flex-1">{{ info.company.companyName }}</view>
<view class="flex-1">{{ item.answerNumber }}家已报价</view>
<view class="flex-1">{{ item._add_time_str }}</view>
<view class="flex-1">
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="vk.navigateTo('/pages/enquiry/detail?id=' + item._id);">查看
</el-button>
</view>
<template v-if="item.productList && item.productList.length > 0 && JSON.stringify(item.productList[0]) !== '{}'">
<view class="text-main flex-1">{{ item.productList[0].goodsName }}</view>
<view class="flex-1">{{ item.productList[0].procureNumber }}{{
item.productList[0].procureUnit
}}
</view>
<view class="flex-1">{{ item.address }}</view>
<view class="flex-1">{{ info.company.companyName }}</view>
<view class="flex-1">{{ item.answerNumber }}家已报价</view>
<view class="flex-1">{{ item._add_time_str }}</view>
<view class="flex-1">
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="vk.navigateTo('/pages/enquiry/detail?id=' + item._id);">查看
</el-button>
</view>
</template>
</view>
<view class="flex justify-between items-start mb-20">
<view class="title">发布的加工单</view>
@@ -142,10 +147,6 @@
<view class="flex justify-center items-center mt-20 w-100p p-20"
v-for="(item, index) in info.processList" :key="index">
<view class="text-main flex-1">{{ item.title }}</view>
<view class="flex-1">{{ item.productList[0].procureNumber }}{{
item.productList[0].procureUnit
}}
</view>
<!-- <view class="flex-1">{{ item.address }}</view>-->
<view class="flex-1">{{ item.num }}</view>
<view class="flex-1">{{ info.company.companyName }}</view>
+1 -1
View File
@@ -91,7 +91,7 @@
</view>
<view class="flex justify-start items-center">
<image :src="item.businessCard.logo" class="logo" v-if="item.businessCard" mode="aspectFill"/>
<view class="logo" v-else/>
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
<view class="ml-35 flex flex-col justify-start items-start">
<text>{{ item.name }}</text>
<i class="el-icon-star-off text-main my-20"/>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@@ -16,16 +16,12 @@ module.exports = {
const otherUser = await vk.baseDao.findByWhereJson({
dbName: 'uni-id-users',
whereJson: {
mobile: "1"
mobile: data.phone
}
})
if (JSON.stringify(otherUser) === '{}') return {
code: -1,
msg: '该用户不存在',
data: {
otherUser,
phone: data.phone
}
msg: '该用户不存在'
}
data.transactionId = vk.pubfn.createOrderNo("C", 20)
@@ -48,6 +44,7 @@ module.exports = {
docTitle: data.title,
type: 'sign',
contractBase: data.contractFile,
partyCount: 2
}
}
})
@@ -0,0 +1,50 @@
'use strict';
module.exports = {
/**
* XXXnameXXX
* @url client/order/kh/add 前端调用的url参数地址
* data 请求参数
* @param {String} params1 参数1
*/
main: async (event) => {
let {data = {}, userInfo, util, filterResponse, originalParam} = event;
let {customUtil, uniID, config, pubFun, vk, db, _} = util;
let {uid} = data;
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
const goods = await vk.baseDao.findById({
dbName: "jjx-goods",
id: data.goodsId
})
// type 0: 商品
// type 1: 自营
const orderId = await vk.baseDao.add({
dbName: "jjx-order",
dataJson: {
orderNo: vk.pubfn.createOrderNo("O", 20),
uid,
orderStatus: 0,
type: data.type,
amount: goods.amount * data.num,
}
})
await vk.baseDao.add({
dbName: "jjx-order-goods",
dataJson: {
orderId: orderId,
goodsId: data.goodsId,
num: data.num,
goodsName: goods.name,
goodsPrice: goods.amount,
goodsCover: goods.cover,
}
})
res.data = orderId
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,63 @@
'use strict';
module.exports = {
/**
* XXXnameXXX
* @url client/order/kh/addFromList 前端调用的url参数地址
* data 请求参数
* @param {String} params1 参数1
*/
main: async (event) => {
let {data = {}, userInfo, util, filterResponse, originalParam} = event;
let {customUtil, uniID, config, pubFun, vk, db, _} = util;
let {uid} = data;
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
let amount = 0
for (const item of data.list) {
const goods = await vk.baseDao.findById({
dbName: "jjx-goods",
id: item.goodsId
})
amount += item.num * goods.amount
}
const orderId = await vk.baseDao.adds({
dbName: "jjx-order",
dataJson: {
orderNo: vk.pubfn.createOrderNo("O", 20),
orderStatus: 0,
type: data.type,
uid,
amount
}
})
const list = []
for (const item of data.list) {
const goods = await vk.baseDao.findById({
dbName: "jjx-goods",
id: item.goodsId
})
list.push({
orderId: orderId,
goodsId: item.goodsId,
num: item.num,
goodsName: goods.name,
goodsPrice: goods.amount,
goodsCover: goods.cover
})
}
await vk.baseDao.adds({
dbName: "jjx-order-goods",
dataJson: list
})
res.data = orderId
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,37 @@
'use strict';
module.exports = {
/**
* XXXnameXXX
* @url client/order/kh/getInfo 前端调用的url参数地址
* data 请求参数
* @param {String} params1 参数1
*/
main: async (event) => {
let {data = {}, userInfo, util, filterResponse, originalParam} = event;
let {customUtil, uniID, config, pubFun, vk, db, _} = util;
let {uid} = data;
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
res = await vk.baseDao.selects({
dbName: "jjx-order",
getOne: true,
getMain: true,
whereJson: {
_id: data.id
},
foreignDB: [
{
dbName: "jjx-order-goods",
localKey: "_id",
foreignKey: "orderId",
as: "goods",
}
]
});
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -1,23 +0,0 @@
'use strict';
module.exports = {
/**
* 此函数名称
* @url client/order/kh/test 前端调用的url参数地址
* data 请求参数
* @params {String} params1 参数1
*/
main: async (event) => {
let { data = {}, userInfo, util, originalParam } = event;
let { customUtil, config, pubFun, vk, db, _ } = util;
let { uid } = data;
let res = { code : 0, msg : '' };
// 业务逻辑开始-----------------------------------------------------------
// 可写与数据库的交互逻辑等等
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,32 @@
'use strict';
module.exports = {
/**
* XXXnameXXX
* @url client/order/kh/updateAddress 前端调用的url参数地址
* data 请求参数
* @param {String} params1 参数1
*/
main: async (event) => {
let { data = {}, userInfo, util, filterResponse, originalParam } = event;
let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
let { uid } = data;
let res = { code: 0, msg: "" };
// 业务逻辑开始-----------------------------------------------------------
await vk.baseDao.updateById({
dbName: "jjx-order",
id: data.id,
dataJson: {
address: data.address,
addressDetail: data.addressDetail,
phone: data.phone,
name: data.name
}
});
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -24,9 +24,10 @@ module.exports = {
whereJson['businessCard.mainSpotCategoryIds'] = _.in(data.mainSpotCategoryIds);
}
// 业务逻辑开始-----------------------------------------------------------
res = await vk.baseDao.getTableData({
res = await vk.baseDao.select({
dbName: dbName.user,
whereJson
whereJson,
pageSize: -1
});
console.log('whereJson', whereJson)
// 业务逻辑结束-----------------------------------------------------------