Browse Source

撤单接口 挂单列表

master
chenkun 4 months ago
parent
commit
6bb4f9efdd
13 changed files with 181 additions and 125 deletions
  1. +2
    -2
      components/user/productList.vue
  2. +4
    -1
      locale/en.json
  3. +4
    -1
      locale/zh-Hans.json
  4. +2
    -2
      pages/index/center2.vue
  5. +7
    -8
      pages/index/tradingPlatform.vue
  6. +17
    -6
      pages_order/auth/registerShop.vue
  7. +81
    -74
      pages_order/auth/selectionIdentity.vue
  8. +3
    -4
      pages_order/center/addressListManage.vue
  9. +1
    -1
      pages_order/components/address/addressList.vue
  10. +36
    -4
      pages_order/components/order/orderList.vue
  11. +1
    -1
      pages_order/order/pendingOrder.vue
  12. +18
    -19
      pages_order/tradingPlatform/nowOrder.vue
  13. +5
    -2
      store/store.js

+ 2
- 2
components/user/productList.vue View File

@ -1,7 +1,7 @@
<template> <template>
<view class="list"> <view class="list">
<view class="item" <view class="item"
v-for="(item, index) in productList"
v-for="(item, index) in list"
@click="immediatePurchase(item)" @click="immediatePurchase(item)"
:key="index"> :key="index">
<image <image
@ -32,7 +32,7 @@
export default { export default {
name: "productList", name: "productList",
props: { props: {
productList: {
list: {
type: Array, type: Array,
default: false default: false
}, },


+ 4
- 1
locale/en.json View File

@ -196,7 +196,10 @@
"supplierOrder": "Supplier Listing", "supplierOrder": "Supplier Listing",
"myOrders": "My Listings", "myOrders": "My Listings",
"payDeposit": "Pay Bond", "payDeposit": "Pay Bond",
"supplierBilLading": "Supplier bill of lading"
"supplierBilLading": "Supplier bill of lading",
"backOrderTitle": "Cancel pending order",
"backOrderTitleConfirm": "Do you confirm the withdrawal? Data cannot be recovered after withdrawal",
"backOrderSuccess": "Successful withdrawal"
}, },
"pages": { "pages": {
"index": { "index": {


+ 4
- 1
locale/zh-Hans.json View File

@ -198,7 +198,10 @@
"supplierBilLading": "供应商提单", "supplierBilLading": "供应商提单",
"supplierOrder": "供应商挂单", "supplierOrder": "供应商挂单",
"myOrders": "我的挂单", "myOrders": "我的挂单",
"payDeposit": "支付保证金"
"payDeposit": "支付保证金",
"backOrderTitle": "撤销挂单",
"backOrderTitleConfirm": "确认撤单吗?撤单后数据不可恢复",
"backOrderSuccess": "撤单成功"
}, },
"pages" : { "pages" : {


+ 2
- 2
pages/index/center2.vue View File

@ -12,10 +12,10 @@
</view> </view>
<view class="info"> <view class="info">
<view class="name"> <view class="name">
倾心.
{{userInfo.nickName}}
</view> </view>
<view class="tips"> <view class="tips">
{{ $t('components.phoneNumber') }}13812345678
{{ $t('components.phoneNumber') }} {{userInfo.phone}}
</view> </view>
</view> </view>
<view class="headBtn" @click="headBtn"> <view class="headBtn" @click="headBtn">


+ 7
- 8
pages/index/tradingPlatform.vue View File

@ -20,20 +20,16 @@
</view> </view>
<view class="supplierList"> <view class="supplierList">
<orderList :orderList="list" />
<orderList :list="list" />
</view> </view>
</view> </view>
<!-- 采购商 --> <!-- 采购商 -->
<view class="purchaser" v-else> <view class="purchaser" v-else>
<!--切换现货/期货-->
<view style="" class="purchaser-title"> <view style="" class="purchaser-title">
<span @click="actionIndexChange(index)"
v-for="(item, index) in type"
:class="actionIndex == index ? 'active' : 'noactive'">{{ item.name }}</span>
<!-- <span @click="actionIndexChange(index)"
:class="actionIndex==index?'active':'noactive'">{{ $t('other.futuresTrading') }}</span> -->
<span @click="actionIndexChange(index)" v-for="(item, index) in type" :class="actionIndex == index ? 'active' : 'noactive'">{{ item.name }}</span>
</view> </view>
<view class="productList"> <view class="productList">
<productList :list="list" /> <productList :list="list" />
</view> </view>
@ -79,9 +75,12 @@
}, },
onLoad() { onLoad() {
if(this.userShop){ if(this.userShop){
this.mixinsListApi = 'getMyProductlist'
// /
this.mixinsListApi = 'productList'
}else{ }else{
//
this.mixinsListApi = 'productlist' this.mixinsListApi = 'productlist'
this.queryParams.productType = this.actionIndex this.queryParams.productType = this.actionIndex
} }
}, },


+ 17
- 6
pages_order/auth/registerShop.vue View File

@ -41,23 +41,24 @@
<input v-model="form.address" :placeholder="$t('other.enterCompanyAddress')" clearable></input> <input v-model="form.address" :placeholder="$t('other.enterCompanyAddress')" clearable></input>
</view> </view>
</view> </view>
<!--dian-->
<!--联系电话-->
<view class="item"> <view class="item">
<view>{{ $t('components.lxPhone')}}</view> <view>{{ $t('components.lxPhone')}}</view>
<view> <view>
<input v-model="form.phone" :placeholder="$t('components.plePhoneNumber')" clearable></input> <input v-model="form.phone" :placeholder="$t('components.plePhoneNumber')" clearable></input>
</view> </view>
</view> </view>
<!---->
<view class="item"> <view class="item">
<view>{{ $t('other.companyAccount')}}</view> <view>{{ $t('other.companyAccount')}}</view>
<view> <view>
<input v-model="form.address" :placeholder="$t('other.enterCompanyAccount')" clearable></input>
<input v-model="form.bankAccount" :placeholder="$t('other.enterCompanyAccount')" clearable></input>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view>{{ $t('components.bankName')}}</view> <view>{{ $t('components.bankName')}}</view>
<view> <view>
<input v-model="form.address" :placeholder="$t('components.enterBankName')" clearable></input>
<input v-model="form.bankNama" :placeholder="$t('components.enterBankName')" clearable></input>
</view> </view>
</view> </view>
</view> </view>
@ -129,29 +130,38 @@
<view class="bottom"> <view class="bottom">
<view class="btns"> <view class="btns">
<!--申请审核-->
<span @click="applyReview" class="sqsh"> <span @click="applyReview" class="sqsh">
{{ $t('components.submitReview') }} {{ $t('components.submitReview') }}
</span> </span>
<!--联系我们-->
<span @click="contactUs" class="lxwm"> <span @click="contactUs" class="lxwm">
{{ $t('components.contactUs') }} {{ $t('components.contactUs') }}
</span> </span>
</view> </view>
<view class="others"> <view class="others">
<!--注册须知-->
<span @click="applyReview" class="zcxz"> <span @click="applyReview" class="zcxz">
{{ $t('components.registrationNotice') }} {{ $t('components.registrationNotice') }}
</span> </span>
<!--框架合同预览-->
<span @click="contactUs" class="kjhtyl"> <span @click="contactUs" class="kjhtyl">
{{ $t('other.frameworkContractPreview') }} {{ $t('other.frameworkContractPreview') }}
</span> </span>
</view> </view>
</view> </view>
<!-- 联系客服弹框 -->
<customerServicePopup ref="customerServicePopup" />
</view> </view>
</template> </template>
<script> <script>
import customerServicePopup from "@/components/config/customerServicePopup.vue";
export default { export default {
components: {customerServicePopup},
onLoad(option) { onLoad(option) {
this.titleIndex = option.identity this.titleIndex = option.identity
}, },
@ -166,13 +176,13 @@ export default {
], ],
form: { form: {
"address": "", "address": "",
"auditStatus": 0,
"bankAccount": "", "bankAccount": "",
"bankInfo": "", "bankInfo": "",
"bankNama": "", "bankNama": "",
"basicAccount": "", "basicAccount": "",
"businessLicense": "", "businessLicense": "",
"companyName": "", "companyName": "",
"id": "",
"password": "", "password": "",
"phone": "", "phone": "",
"role": 0, "role": 0,
@ -187,7 +197,7 @@ export default {
methods: { methods: {
// //
applyReview() { applyReview() {
this.$api('loginLogout', res => {
this.$api('roleOption',this.form, res => {
if (res.code == 200) { if (res.code == 200) {
uni.removeStorageSync('token') uni.removeStorageSync('token')
this.$store.state.userInfo = {} this.$store.state.userInfo = {}
@ -199,7 +209,8 @@ export default {
}, },
// //
contactUs() { contactUs() {
console.log("打开客服弹框")
this.$refs.customerServicePopup.open();
}, },


+ 81
- 74
pages_order/auth/selectionIdentity.vue View File

@ -1,93 +1,100 @@
<template> <template>
<view>
<view>
<navbar :title="$t('pageTitle.selectIdentity')"
:leftClick="!$route.query.back" @leftClick="$utils.navigateBack" />
<navbar :title="$t('pageTitle.selectIdentity')"
:leftClick="!$route.query.back" @leftClick="$utils.navigateBack"/>
<view class="container">
<view class="container">
<view class="title">{{ $t('components.selectIdentity') }}</view>
<view class="button-group">
<!--供应商-->
<view class="identity-button" @click="selectIdentity(0)">
<view class="identity-text"> {{ $t('other.iAmBuyer') }}</view>
<view class="identity-icon">
<img src="../../static/image/index/5.png" style="width: 100%; height: 100%;">
</view>
</view>
<!--采购-->
<view class="identity-button" @click="selectIdentity(1)">
<view class="identity-text"> {{ $t('other.iAmSupplier') }}</view>
<view class="identity-icon">
<img src="../../static/image/index/6.png" style="width: 100%; height: 100%;">
</view>
</view>
</view>
</view>
</view>
<view class="title">{{ $t('components.selectIdentity') }}</view>
<view class="button-group">
<!--供应商-->
<view class="identity-button" @click="selectIdentity(0)">
<view class="identity-text"> {{ $t('other.iAmBuyer') }}</view>
<view class="identity-icon">
<img src="../../static/image/index/5.png" style="width: 100%; height: 100%;">
</view>
</view>
<!--采购-->
<view class="identity-button" @click="selectIdentity(1)">
<view class="identity-text"> {{ $t('other.iAmSupplier') }}</view>
<view class="identity-icon">
<img src="../../static/image/index/6.png" style="width: 100%; height: 100%;">
</view>
</view>
</view>
</view>
</view>
</template> </template>
<script> <script>
export default {
methods: {
selectIdentity(identity) {
uni.navigateTo({
url: `/pages_order/auth/registerShop?identity=${identity}`
})
},
}
}
import {mapGetters} from 'vuex'
export default {
computed: {
...mapGetters(['userShop', "userInfo"]),
},
methods: {
selectIdentity(identity) {
// if (userInfo)
uni.navigateTo({
url: `/pages_order/auth/registerShop?identity=${identity}`
})
},
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
* {
box-sizing: border-box;
}
* {
box-sizing: border-box;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
//height: 100vh;
background-color: #f5f5f5;
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
//height: 100vh;
background-color: #f5f5f5;
.title {
font-size: 40rpx;
color: #333;
margin: 80rpx 0;
}
.title {
font-size: 40rpx;
color: #333;
margin: 80rpx 0;
}
.button-group {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.button-group {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100vw;
//padding: 0 20px;
width: 100vw;
//padding: 0 20px;
.identity-button {
display: flex;
align-items: center;
justify-content: space-between;
width: 80%;
margin-bottom: 40rpx;
padding: 40rpx 50rpx;
background-color: #2d2f59;
border-radius: 20rpx;
color: white;
.identity-button {
display: flex;
align-items: center;
justify-content: space-between;
width: 80%;
margin-bottom: 40rpx;
padding: 40rpx 50rpx;
background-color: #2d2f59;
border-radius: 20rpx;
color: white;
.identity-text {
font-size: 40rpx;
}
.identity-text {
font-size: 40rpx;
}
.identity-icon {
width: 130rpx;
height: 130rpx;
}
}
}
}
.identity-icon {
width: 130rpx;
height: 130rpx;
}
}
}
}
</style> </style>

+ 3
- 4
pages_order/center/addressListManage.vue View File

@ -123,11 +123,10 @@ export default {
// //
deleteAddress(id) { deleteAddress(id) {
console.log("==========")
let self = this let self = this
uni.showModal({ uni.showModal({
title: '删除地址',
content: '确认删除此地址?删除后数据不可恢复',
title: this.$t('components.deleteAddress'),
content: this.$t('components.confirmDeleteAddress'),
success(e) { success(e) {
if(e.confirm){ if(e.confirm){
self.$api('deleteAddress', { self.$api('deleteAddress', {
@ -135,7 +134,7 @@ export default {
}, res => { }, res => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '删除成功',
title: this.$t('components.deleteSuccessful'),
icon: 'none' icon: 'none'
}) })
self.getAddressList() self.getAddressList()


+ 1
- 1
pages_order/components/address/addressList.vue View File

@ -114,7 +114,7 @@ export default {
}, },
// //
deleteAddress(e){ deleteAddress(e){
console.log(e,"$emitdeleteAddress")
this.$emit('deleteAddress', e) this.$emit('deleteAddress', e)
}, },
// //


+ 36
- 4
pages_order/components/order/orderList.vue View File

@ -1,6 +1,6 @@
<template> <template>
<view class="page"> <view class="page">
<view class="item" v-for="(item, index) in orderList" :key="index">
<view v-if="list.length>0" class="item" v-for="(item, index) in list" :key="index">
<view class="top"> <view class="top">
<view class="service"> <view class="service">
<text>{{ $t('other.aluminumProducts') }}</text> <text>{{ $t('other.aluminumProducts') }}</text>
@ -40,12 +40,23 @@
</view> </view>
<!--撤单按钮-->
<view class="bottom" v-if="showBackOrder"> <view class="bottom" v-if="showBackOrder">
<view @click="backOrder" class="btn">
<view @click="backOrder(item.id)" class="btn">
{{ $t('other.withdrawOrder') }} {{ $t('other.withdrawOrder') }}
</view> </view>
</view> </view>
</view> </view>
<!--无历史记录-->
<view
style="padding: 100rpx 0;"
v-else>
<uv-empty
mode="history"
textSize="28rpx"
iconSize="100rpx"/>
</view>
</view> </view>
</template> </template>
@ -53,7 +64,7 @@
export default { export default {
name: "orderList", name: "orderList",
props: { props: {
orderList: {
list: {
type: Array, type: Array,
default: false default: false
}, },
@ -78,7 +89,25 @@ export default {
}, },
// //
backOrder() {
backOrder(id) {
let self = this
uni.showModal({
title: this.$t('other.backOrderTitle'),
content: this.$t('other.backOrderTitleConfirm'),
success(e) {
if(e.confirm){
self.$api('noShow', {id}, res => {
if (res.code == 200) {
uni.showToast({
title: this.$t('other.backOrderSuccess'),
icon: 'none'
})
self.getAddressList()
}
})
}
}
})
uni.navigateTo({ uni.navigateTo({
url: `/pages_order/order/backOrder?id=1` url: `/pages_order/order/backOrder?id=1`
}) })
@ -94,6 +123,9 @@ export default {
flex-direction: column; flex-direction: column;
gap: 20rpx; gap: 20rpx;
height: calc(90vh - 180rpx);
.item { .item {
padding: 20rpx; padding: 20rpx;


+ 1
- 1
pages_order/order/pendingOrder.vue View File

@ -7,7 +7,7 @@
<view class="frame"> <view class="frame">
<view class="content"> <view class="content">
<orderList :orderList="list" :show-back-order="true"></orderList>
<orderList :list="list" :show-back-order="true"></orderList>
</view> </view>
</view> </view>


+ 18
- 19
pages_order/tradingPlatform/nowOrder.vue View File

@ -14,7 +14,7 @@
<view class="item"> <view class="item">
<view>{{ $t('components.productSpe') }}</view> <view>{{ $t('components.productSpe') }}</view>
<view> <view>
铝制品(Al>96%)
{{$t('other.aluminumProducts') }}
</view> </view>
</view> </view>
@ -50,9 +50,9 @@
<view class="value"> <view class="value">
<view class="dateTimeCls"> <view class="dateTimeCls">
<view class="date" @click="startDateOpen"> <view class="date" @click="startDateOpen">
{{ form.deliveryDate }}
<uv-datetime-picker ref="startDateRef"
v-model="form.deliveryDate"
{{ form.takeTime }}
<uv-datetime-picker ref="startDateRef"
v-model="form.takeTime"
mode="date" mode="date"
@confirm="startDateChange"></uv-datetime-picker> @confirm="startDateChange"></uv-datetime-picker>
</view> </view>
@ -69,9 +69,9 @@
<view class="tentativeQuantity"> <view class="tentativeQuantity">
<view class="key">{{ $t('other.tentativeQuantity') }}</view> <view class="key">{{ $t('other.tentativeQuantity') }}</view>
<view class="value"> <view class="value">
<uv-number-box
<uv-number-box @change="form.deposit = (fatherData.price * form.num * (0.02)).toFixed(2)"
inputWidth="200rpx" inputWidth="200rpx"
v-model="form.tentativeQuantity" :max="fatherData.num"></uv-number-box>
v-model="form.num" :max="fatherData.num"></uv-number-box>
</view> </view>
</view> </view>
@ -87,7 +87,7 @@
<view class="performanceBond"> <view class="performanceBond">
<view class="key">{{ $t('other.performanceDeposit') }}</view> <view class="key">{{ $t('other.performanceDeposit') }}</view>
<view class="value"> <view class="value">
<input v-model="form.performanceBond" clearable></input>
<input v-model="form.deposit" clearable></input>
</view> </view>
</view> </view>
@ -138,23 +138,22 @@
const fatherData = JSON.parse(decodeURIComponent(options.params)); const fatherData = JSON.parse(decodeURIComponent(options.params));
console.log(fatherData, "fatherData==========") console.log(fatherData, "fatherData==========")
this.fatherData = fatherData; this.fatherData = fatherData;
this.form.deposit = (fatherData.price * this.form.num * (0.02)).toFixed(2);
} }
}, },
data() { data() {
return { return {
fatherData: {}, fatherData: {},
form: { form: {
currentRegion: '',
address: '',
tentativeQuantity: 0,
deliveryDate: dayjs(new Date()).format("YYYY-MM-DD"),
price: 0,
performanceBond: 0,
latitude: '',
longitude: '',
},
phoneNumber: '00000000000'
"address": "",
"addressId": "",
"deposit": 0,
"id": "",
"num": 1,
"price": 0,
"productId": "",
"takeTime": ""
},
} }
}, },
methods: { methods: {
@ -173,7 +172,7 @@
startDateChange(val) { startDateChange(val) {
this.$nextTick(() => { this.$nextTick(() => {
this.form.deliveryDate = dayjs(val.value).format("YYYY-MM-DD")
this.form.takeTime = dayjs(val.value).format("YYYY-MM-DD")
}); });
}, },
startDateOpen() { startDateOpen() {


+ 5
- 2
store/store.js View File

@ -18,7 +18,11 @@ const store = new Vuex.Store({
// 角色 true 为供应商 false 为采购商 // 角色 true 为供应商 false 为采购商
userShop(state){ userShop(state){
return state.shop return state.shop
}
},
userInfo(state){
return state.userInfo
},
}, },
mutations: { mutations: {
// 初始化配置 // 初始化配置
@ -50,7 +54,6 @@ const store = new Vuex.Store({
if(res.code != 200){ if(res.code != 200){
return return
} }
state.userInfo = res.result.userInfo state.userInfo = res.result.userInfo
state.buy = res.result.buy state.buy = res.result.buy
state.shop = res.result.shop state.shop = res.result.shop


Loading…
Cancel
Save