Authored by huangyCode

修改订单业务

... ... @@ -34,13 +34,20 @@ Component({
this.dialog = this.selectComponent("#dialog");
wx.getLocation({
success: (res) => {
param.user_latitude = res.latitude;
param.user_longitude = res.longitude;
param.storeId = this.properties.storeId;
param.user_latitude = '32.049999';
param.user_longitude = '118.790001';
param.store_id = this.properties.storeId;
storeApi.checkStore(param, () => {
wx.hideLoading();
}).then(r => {
if (!r.isInRange) {
this.setData({
// 弹窗显示控制
content: "Sorry,您的位置不在门店范围内,不能选择门店自提方式购买该商品",
cancelText: "线上购买",
confirmText: "知道了",
type: 0
});
this.dialog.showDialog();
resolve({result: false})
} else {
... ...
... ... @@ -12,6 +12,10 @@ Component({
value: {
}
},
isStore: {
type:Boolean,
value: false
}
},
data: {//组件内部数据
... ...
... ... @@ -5,6 +5,7 @@
<view class="productRightContainer">
<text class="productPrice">¥{{productInfo.goodPrice}}</text>
<text class="productName">{{productInfo.productName}}</text>
<text class="productColor">{{productInfo.colorName + ',' + productInfo.sizeName}}</text>
<text class="productColor" wx:if="{{isStore}}">{{productInfo.colorName + ',' + productInfo.sizeName + ',' +productInfo.skup}}</text>
<text class="productColor" wx:else>{{productInfo.colorName + ',' + productInfo.sizeName}}</text>
</view>
</view>
... ...
... ... @@ -24,18 +24,18 @@ Page({
isStore: 0,
storeId: 0
},
onLoad: function (option) {
onLoad: async function (option) {
console.log(option)
this.setData({
isStore: option.is_store || 0,
isStore: Number(option.is_store) || 0,
storeId: option.store_id || 0,
skup: option.skup || '',
product_id: option.product_id || '',
hasAddress: false
})
this.fetchData(option.is_store);
await this.fetchData(option.is_store);
if (!option.is_store) {
this.fetchAddress()
await this.fetchAddress()
}
},
... ... @@ -50,6 +50,14 @@ Page({
let data;
if (isStore) {
data = await api.createOfflinePayment(params, () => wx.hideLoading())
// let index;
// data.promotionFormulaList.forEach((value, i) => {
// if (value.promotion === '运费') {
// index = i;
// break;
// }
// })
// data.promotionFormulaList.splice(index,1)
} else {
data = await api.createPaymentInfo(params, () => wx.hideLoading())
}
... ... @@ -59,14 +67,14 @@ Page({
this.setData(data)
},
fetchAddress() {
async fetchAddress() {
wx.showLoading({
title: '',
})
let params = {}
api.yohoApi().buyerGetAddress(params, () => wx.hideLoading())
await api.yohoApi().buyerGetAddress(params, () => wx.hideLoading())
.then(data => {
if (Array.isArray(data)) {
for (let item of data) {
... ... @@ -91,6 +99,7 @@ Page({
.catch(error => {
console.log(error)
})
api.defaultApi();
},
async submit() {
... ... @@ -121,12 +130,12 @@ Page({
let addressId = this.data.hasAddress && this.data.address && this.data.address.address_id
let skup = this.data.skup
let channelNo = ''
let channelNo = '';
wx.showLoading({
title: '',
})
debugger;
data = await api.buyerSubmit(skup, channelNo, addressId, () => wx.hideLoading());
}
if (data && data.orderCode) {
... ...
... ... @@ -7,7 +7,7 @@
<storeAddress storeName="{{storeName}}" storeAddress="{{storeAddress}}" bindaddressevent="chooseAddress"
wx:else></storeAddress>
<productCell productInfo="{{good}}"></productCell>
<productCell productInfo="{{good}}" isStore="{{isStore === 1}}"></productCell>
<priceCell promotionFormulaList="{{promotionFormulaList}}" damagesDesc="{{damagesDesc}}"></priceCell>
<payDeliveryCell paymentWay="{{paymentWay}}" deliveryWay="{{deliveryWay}}"></payDeliveryCell>
</scroll-view>
... ...
... ... @@ -18,7 +18,7 @@
</view>
</view>
<image class='order-detail-right-arrow-image' src='../../assets/images/right-arrow@3x.png'></image>
</view>
<view class='order-detail-split-line' wx:if="{{data.lastExpressInfo}}"></view>
... ...