1、修复签约宝问题
2、其他调整
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user