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
+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"/>