diff --git a/api/api.js b/api/api.js
index 6557cf2..2e22f71 100644
--- a/api/api.js
+++ b/api/api.js
@@ -80,6 +80,11 @@ const config = {
url: '/product/addProductOrder',
method: 'POST',
},
+ // 确认-取消订单
+ updateOrder: {
+ url: '/product/updateOrder',
+ method: 'POST',
+ },
// 我的挂单列表
getMyProductlist: {
url: '/product/myProductlist',
@@ -136,6 +141,7 @@ const config = {
getImagePhoneOther: {
url: '/index/index',
method: 'POST',
+ limit: 500,
},
diff --git a/components/user/productList.vue b/components/user/productList.vue
index cfd180e..e040847 100644
--- a/components/user/productList.vue
+++ b/components/user/productList.vue
@@ -44,9 +44,10 @@ export default {
// 立即购买
immediatePurchase(item) {
console.log("====")
- var itemStr = encodeURIComponent(JSON.stringify(item));
+ // var itemStr = encodeURIComponent(JSON.stringify(item));
+ this.$store.state.productDetail = item
uni.navigateTo({
- url: `/pages_order/tradingPlatform/nowOrder?params=${itemStr}`,
+ url: `/pages_order/tradingPlatform/nowOrder`,
});
}
},
diff --git a/locale/zh-Hans.json b/locale/zh-Hans.json
index aa3d505..1ad4e74 100644
--- a/locale/zh-Hans.json
+++ b/locale/zh-Hans.json
@@ -171,7 +171,7 @@
"aluminumProducts": "铝制品",
"tentativeQuantity": "暂定数量(吨)",
"performanceDeposit": "履约保证金",
- "priceQuantityPercentage": "(单价*数量*2%)",
+ "priceQuantityPercentage": "(单价*数量*{0}%)",
"companyName": "公司名称",
"enterCompanyName": "请输入公司名称",
"taxCode": "税收编码",
diff --git a/pages/index/center2.vue b/pages/index/center2.vue
index d1bf05d..cba9696 100644
--- a/pages/index/center2.vue
+++ b/pages/index/center2.vue
@@ -34,7 +34,7 @@
-
+
@@ -59,6 +59,7 @@ export default {
},
data() {
return {
+ // 供应商
supplierList: [
{text: `${this.$t('pageTitle.myOrders')}`,englishText:'myOrders', value: ">", imgUrl: '/static/image/center/14.svg', toPathUrl: '/pages_order/order/pendingOrder'},
{text: `${this.$t('components.contactCustomerService')}`, englishText:'contactCustomerService',value: ">", imgUrl: '/static/image/center/13.svg'},
@@ -66,10 +67,11 @@ export default {
{text: `${this.$t('components.helpFeedback')}`,englishText:'systemSettings', value: ">", imgUrl: '/static/image/center/12.svg', toPathUrl: '/pages_order/center/helpFeedback'},
{text: `${this.$t('components.aboutUs')}`, englishText:'aboutUs',value: ">", imgUrl: '/static/image/center/13.svg'},
],
+ // 采购商
purchaserList: [
// this.$t('pages.index.index.companyProfile')
{text: `${this.$t('components.contactCustomerService')}`, englishText:'contactCustomerService',value: ">", imgUrl: '/static/image/center/13.svg'},
- {text: `${this.$t('components.contactCustomerService')}`,englishText:'systemSettings', value: ">", imgUrl: '/static/image/center/12.svg', toPathUrl: '/pages_order/center/systemSet'},
+ {text: `${this.$t('components.systemSettings')}`,englishText:'systemSettings', value: ">", imgUrl: '/static/image/center/12.svg', toPathUrl: '/pages_order/center/systemSet'},
{text: `${this.$t('components.helpFeedback')}`,englishText:'systemSettings', value: ">", imgUrl: '/static/image/center/12.svg', toPathUrl: '/pages_order/center/helpFeedback'},
{text: `${this.$t('components.aboutUs')}`, englishText:'aboutUs',value: ">", imgUrl: '/static/image/center/13.svg'},
]
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 2f088c6..b30ef7b 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -144,6 +144,7 @@
url: '/pages_order/auth/selectionIdentity?back=no&'
})
}
+ this.$store.commit('getUserInfo')
},
computed: {
...mapGetters(['userShop']),
@@ -169,9 +170,8 @@
}
.page {
-
background-color: #2e394d;
-
+ min-height: 100vh;
// 供应商
.supplier {
display: flex;
diff --git a/pages_order/auth/registerShop.vue b/pages_order/auth/registerShop.vue
index b2d2974..f558701 100644
--- a/pages_order/auth/registerShop.vue
+++ b/pages_order/auth/registerShop.vue
@@ -271,7 +271,7 @@
\ No newline at end of file
diff --git a/pages_order/tradingPlatform/nowOrder.vue b/pages_order/tradingPlatform/nowOrder.vue
index b6cc732..2f8dc91 100644
--- a/pages_order/tradingPlatform/nowOrder.vue
+++ b/pages_order/tradingPlatform/nowOrder.vue
@@ -14,7 +14,7 @@
{{ $t('components.productSpe') }}
- {{$t('other.aluminumProducts') }}
+ {{$t('other.aluminumProducts') }}
@@ -48,12 +48,14 @@
{{ $t('components.deliveryDate') }}
-
-
+
+
{{ form.takeTime }}
-
@@ -69,9 +71,8 @@
{{ $t('other.tentativeQuantity') }}
-
+
@@ -87,14 +88,15 @@
{{ $t('other.performanceDeposit') }}
-
+
+ {{ deposit }}
- {{ $t('other.priceQuantityPercentage') }}
+ {{ $t('other.priceQuantityPercentage', [10]) }}
- ‘
+
@@ -132,38 +134,70 @@
},
computed: {
...mapGetters(['userShop']),
+ deposit(){
+ return (this.fatherData.price * this.form.num * (0.1)).toFixed(2)
+ },
},
onLoad(options) {
- if (options.params) {
- const fatherData = JSON.parse(decodeURIComponent(options.params));
+ // if (options.params) {
+ // const fatherData = JSON.parse(decodeURIComponent(options.params));
+
+ // 从vuex里面拿
+ const fatherData = this.$store.state.productDetail
+
console.log(fatherData, "fatherData==========")
this.fatherData = fatherData;
- this.form.deposit = (fatherData.price * this.form.num * (0.02)).toFixed(2);
- }
+
+ // 计算保证金 这个改成计算属性
+ // this.form.deposit = (fatherData.price * this.form.num * (0.02)).toFixed(2);
+
+ // }
},
data() {
return {
fatherData: {},
form: {
- "address": "",
- "addressId": "",
- "deposit": 0,
- "id": "",
- "num": 1,
- "price": 0,
- "productId": "",
- "takeTime": ""
- },
+ "address": "",
+ "addressId": "",
+ "deposit": 0,
+ "id": "",
+ "num": 1,
+ "price": 0,
+ "productId": "",
+ "takeTime": ""
+ },
+ id : 0,
}
},
+
methods: {
// 立即下单
ljxd() {
- var itemStr = encodeURIComponent(JSON.stringify(this.form));
- uni.navigateTo({
- url: `/pages_order/tradingPlatform/confirmOrder?params=${itemStr}`,
- });
+ // var itemStr = encodeURIComponent(JSON.stringify(this.form));
+ // uni.navigateTo({
+ // url: `/pages_order/tradingPlatform/confirmOrder`,
+ // });
+
+ this.form.deposit = this.deposit
+ this.form.productId = this.fatherData.id
+
+ if(this.$utils.verificationAll(this.form, {
+ "takeTime": '请选择交货时间',
+ })){
+ return
+ }
+
+ this.$api('addProductOrder', this.form, res => {
+ if(res.code == 200){
+ // 从vuex里面拿
+ this.$store.state.cartInfo = res.result
+
+ uni.navigateTo({
+ url: `/pages_order/tradingPlatform/confirmOrder`,
+ });
+ }
+ })
},
// 联系我们
contactUs() {
@@ -176,6 +210,7 @@
});
},
startDateOpen() {
+ console.log(1);
this.$refs.startDateRef.open();
},
diff --git a/store/store.js b/store/store.js
index f96372c..c868a87 100644
--- a/store/store.js
+++ b/store/store.js
@@ -15,6 +15,8 @@ const store = new Vuex.Store({
shopData : {},
buy : {},
customerPhone : '',//客服电话
+ productDetail : {},//商品详情用于中转
+ cartInfo : {},//采购商下单的时候供应商开户行信息
},
getters: {
// 角色 true 为供应商 false 为采购商
@@ -62,7 +64,7 @@ const store = new Vuex.Store({
state.shop = !!res.result.shop
uni.setStorageSync('token', res.result.token)
- if(!state.shop && !state.buy){
+ if(!state.shopData && !state.buy){
uni.reLaunch({
url: '/pages_order/auth/selectionIdentity?back=no&'
})
@@ -73,11 +75,31 @@ const store = new Vuex.Store({
}
})
},
+ // 获取个人信息
getUserInfo(state){
api('getImagePhoneOther', res => {
if(res.code == 200){
state.userInfo = res.result.my
state.customerPhone = res.result.phone
+
+
+ state.buy = res.result.buy
+ state.shopData = res.result.shop
+
+ // 如果什么身份都没有,就去注册
+ if(!state.shopData && !state.buy){
+ uni.reLaunch({
+ url: '/pages_order/auth/selectionIdentity?back=no&'
+ })
+ }
+
+ // 没有供应商身份
+ if(!state.shopData){
+ state.shop = false
+ // 没有采购商身份
+ }else if(!state.buy){
+ state.shop = true
+ }
}
})
},