交易市场

This commit is contained in:
唐明明
2021-09-18 12:00:49 +08:00
parent 314f43f0cc
commit bab69de284
8 changed files with 22320 additions and 21697 deletions

View File

@@ -41,10 +41,9 @@ const marketsBuy = (id, data) => {
} }
// 转让市场支付 // 转让市场支付
const marketsPay = (id, platform, data) => { const marketsPay = (id, platform) => {
return request({ return request({
url: 'markets/pay/' + id + '/' + platform, url: 'markets/pay/' + id + '/' + platform
data
}) })
} }

View File

@@ -499,6 +499,16 @@
"style" : { "style" : {
"navigationBarTitleText": "转让详情" "navigationBarTitleText": "转让详情"
} }
},{
"path" : "pages/market/goods",
"name" : "marketGoods",
"style": {
"navigationBarTitleText": "锚定商品",
"titleNView": {
"backgroundColor": "#FFFFFF",
"type": "transparent"
}
}
} }
], ],
"tabBar": { "tabBar": {

View File

@@ -7,7 +7,7 @@
<view class="title nowrap">数字权证</view> <view class="title nowrap">数字权证</view>
<view class="text nowrap">锚定商品{{info.goods.goods_name}}</view> <view class="text nowrap">锚定商品{{info.goods.goods_name}}</view>
<view class="text nowrap">提供企业{{info.company.name}}</view> <view class="text nowrap">提供企业{{info.company.name}}</view>
<view class="text nav-goods nowrap">查看锚定商品信息<uni-icons type="arrowright" size="12" color="#e93340"></uni-icons></view> <view class="text nav-goods nowrap" @click="onGoods">查看锚定商品信息<uni-icons type="arrowright" size="12" color="#e93340"></uni-icons></view>
</view> </view>
<view class="info"> <view class="info">
<view class="info-item"> <view class="info-item">
@@ -65,7 +65,7 @@
<label> <label>
<radio class="pay-radio" value="eb" checked color="#e93340" /> <radio class="pay-radio" value="eb" checked color="#e93340" />
<view class="pay-title">易货额支付</view> <view class="pay-title">易货额支付</view>
<view class="pay-sub-title">可用10冻结10</view> <view class="pay-sub-title">可用{{account.eb}}冻结{{account.frozenEb}}</view>
</label> </label>
</view> </view>
<view class="item"> <view class="item">
@@ -91,11 +91,15 @@
price : '0.00', price : '0.00',
stock : 1, stock : 1,
loding : true, loding : true,
info : {} info : {},
account : {
eb : '0.00',
frozenEb: '0.00'
}
}; };
}, },
created() { created() {
marketsInfo(5).then(res =>{ marketsInfo(this.$Route.query.marketId || 5).then(res =>{
this.info = res this.info = res
this.price = res.price this.price = res.price
this.loding = false this.loding = false
@@ -107,6 +111,10 @@
}) })
}, },
methods:{ methods:{
// 查看锚定产品
onGoods(){
this.$Router.push({name: 'marketGoods', params: { id: this.info.goods.goods_id }})
},
// 选择购买方式 // 选择购买方式
payType(e){ payType(e){
this.payValue = e.detail.value this.payValue = e.detail.value
@@ -121,9 +129,10 @@
}, },
// 提交购买单 // 提交购买单
buy(){ buy(){
marketsBuy(5, { marketsBuy(this.info.market_id, {
qty: this.stock qty: this.stock
}).then(res => { }).then(res => {
this.account = res.account
this.orderNo = res.market_order_no this.orderNo = res.market_order_no
this.$refs.buyLay.close() this.$refs.buyLay.close()
this.$refs.payLay.open('bottom') this.$refs.payLay.open('bottom')
@@ -137,23 +146,38 @@
// 支付 // 支付
orderPay(){ orderPay(){
let data = {} let data = {}
if(this.payValue === 'wechat'){ marketsPay(this.orderNo, this.payValue).then(res => {
data = { switch (this.payValue){
type : 'app', case 'eb':
openid : ''
}
}
marketsPay(this.info.market_id, this.payValue, {
market_no: this.orderNo,
...data
}).then(res => {
console.log(res) console.log(res)
console.log('支付结果')
break
case 'wechat':
this.wxPay(JSON.parse(res))
break
}
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon : 'none'
}) })
}) })
},
// 微信支付
wxPay(payConfig){
uni.requestPayment({
provider : 'wxpay',
orderInfo : payConfig,
success : payRes => {
console.log(payRes)
},
fail : payErr => {
uni.showToast({
title: payErr.errMsg,
icon : 'none'
})
}
})
} }
} }
} }

116
pages/market/goods.vue Normal file
View File

@@ -0,0 +1,116 @@
<template>
<view>
<view class="goods-cover">
<swiper class="swiper" circular indicator-dots indicator-active-color="#e93340">
<swiper-item v-for="(item, index) in cover" :key="index">
<view class="swiper-item">
<image class="swiper-cover" :src="item" mode="aspectFill" />
</view>
</swiper-item>
</swiper>
</view>
<view class="info">
<view class="info-item">
<label>锚定商品</label>
{{info.name}}
</view>
<view class="info-item">
<label>商品规格</label>
{{info.skusUnit}}
</view>
<view class="info-item">
<label>提供企业</label>
{{info.companyName}}
</view>
<view class="info-item">
<label>企业诚信</label>
{{info.integrity}}
</view>
<view class="info-item">
<label>权证销量</label>
{{info.sales}}
</view>
<view class="info-item">
<label>发布时间</label>
{{info.createdAt}}
</view>
</view>
</view>
</template>
<script>
import { goods } from '@/apis/interfaces/goods'
export default {
data() {
return {
cover: [],
info : {}
};
},
created() {
goods(this.$Route.query.id).then(res => {
console.log(res)
this.cover = res.pictures
this.info = {
name : res.name,
companyName : res.company.name,
createdAt : res.created_at,
sales : res.sales,
integrity : res.company.integrity,
skusUnit : res.skus[0].unit
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
</script>
<style lang="scss">
// 数权
.goods-cover{
width: 100%;
padding-top: 100%;
position: relative;
background: #f5f5f5;
.swiper{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.swiper-item{
height: 100%;
width: 100%;
}
.swiper-cover{
@extend .swiper-item;
}
}
}
// 锚定商品详情
.info{
background: white;
padding: $padding;
.info-item{
padding-left: 200rpx;
height: 70rpx;
line-height: 70rpx;
position: relative;
text-align: right;
font-size: $title-size-m;
@extend .nowrap;
label{
position: absolute;
left: 0;
top: 0;
width: 200rpx;
text-align: left;
color: $text-gray;
}
}
}
</style>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__CD19AAD","name":"易品新境","version":{"name":"1.0.0","code":"100"},"description":"易品新境为商家提供营销引流工具","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#f5f5f5"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"oauth":{"univerify":{},"weixin":{"appid":"wx222fbe58feee7819","appsecret":"3d24525a636d7573a8fae885097d5cf7","UniversalLinks":""}},"payment":{"weixin":{"__platform__":["android"],"appid":"wx222fbe58feee7819","UniversalLinks":""}},"share":{"weixin":{"appid":"wx222fbe58feee7819","UniversalLinks":""}},"maps":{},"ad":{},"geolocation":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"arguments":"{\"id\":1,\"name\":\"pages/market/details\",\"pathName\":\"pages/market/details\",\"query\":\"\"}","allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.2.3","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#bababa","selectedColor":"#e93340","backgroundColor":"#FFFFFF","borderStyle":"rgba(255,255,255,0.4)","list":[{"pagePath":"pages/equity/index","text":"通证权易","iconPath":"static/tabBar/tabBar_icon_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png"},{"pagePath":"pages/market/index","text":"转让市场","iconPath":"static/tabBar/tabBar_icon_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png"},{"pagePath":"pages/store/index","text":"企业工具","iconPath":"static/tabBar/tabBar_icon_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png"},{"pagePath":"pages/property/index","text":"我的资产","iconPath":"static/tabBar/tabBar_icon_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png"}],"height":"50px"},"launch_path":"__uniappview.html"}} {"@platforms":["android","iPhone","iPad"],"id":"__UNI__CD19AAD","name":"易品新境","version":{"name":"1.0.0","code":"100"},"description":"易品新境为商家提供营销引流工具","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#f5f5f5"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"oauth":{"univerify":{},"weixin":{"appid":"wx222fbe58feee7819","appsecret":"3d24525a636d7573a8fae885097d5cf7","UniversalLinks":""}},"payment":{"weixin":{"__platform__":["android"],"appid":"wx222fbe58feee7819","UniversalLinks":""}},"share":{"weixin":{"appid":"wx222fbe58feee7819","UniversalLinks":""}},"maps":{},"ad":{},"geolocation":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"arguments":"{\"name\":\"\",\"path\":\"\",\"query\":\"\",\"id\":0}","allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.2.3","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#bababa","selectedColor":"#e93340","backgroundColor":"#FFFFFF","borderStyle":"rgba(255,255,255,0.4)","list":[{"pagePath":"pages/equity/index","text":"通证权易","iconPath":"static/tabBar/tabBar_icon_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png"},{"pagePath":"pages/market/index","text":"转让市场","iconPath":"static/tabBar/tabBar_icon_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png"},{"pagePath":"pages/store/index","text":"企业工具","iconPath":"static/tabBar/tabBar_icon_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png"},{"pagePath":"pages/property/index","text":"我的资产","iconPath":"static/tabBar/tabBar_icon_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}}