地址
This commit is contained in:
parent
39881425ed
commit
5ced2d0106
|
|
@ -94,7 +94,7 @@
|
|||
"quickapp" : {},
|
||||
/* 快应用特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx9ffab147a56e9424",
|
||||
"appid" : "wxa17265f5fe8374b1",
|
||||
"setting" : {
|
||||
"urlCheck" : true,
|
||||
"postcss" : true,
|
||||
|
|
|
|||
|
|
@ -14,13 +14,15 @@
|
|||
</view>
|
||||
<view class="bottom" @click="isSelect(item)">
|
||||
{{item.areaName + item.address}}
|
||||
<u-icon name="edit-pen" :size="40" color="#999999" v-show="type != 'order'" @click="toEdit(item.id)"></u-icon>
|
||||
<u-icon name="edit-pen" :size="40" color="#999999"
|
||||
@click="toEdit(item.id)"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 无数据时默认显示 -->
|
||||
<view class="coreshop-emptybox" v-else>
|
||||
<u-empty :src="$globalConstVars.apiFilesUrl+'/static/images/empty/address.png'" icon-size="300" text="暂无地址信息" mode="list"></u-empty>
|
||||
<u-empty :src="$globalConstVars.apiFilesUrl+'/static/images/empty/address.png'" icon-size="300"
|
||||
text="暂无地址信息" mode="list"></u-empty>
|
||||
</view>
|
||||
<view class="coreshop-bottomBox">
|
||||
<button class="coreshop-btn coreshop-btn-b coreshop-btn-square" @click="toAdd()">新增收货地址</button>
|
||||
|
|
@ -71,7 +73,7 @@
|
|||
|
||||
beforePage.$vm.userShip = data;
|
||||
beforePage.$vm.params.areaId = data.areaId;
|
||||
|
||||
uni.setStorageSync("adders_userShip", data);
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,12 +5,15 @@
|
|||
<div class="content">
|
||||
<view>
|
||||
<view class="u-margin-left-20 u-margin-right-20 u-margin-top-20">
|
||||
<u-subsection :list="typeItems" mode="subsection" :current="typeCurrent" @change="onTypeItem" bg-color="#ffffff" active-color="#e54d42" v-if="storeSwitch == 1" style="border-radius:0;"></u-subsection>
|
||||
<u-subsection :list="typeItems" mode="subsection" :current="typeCurrent" @change="onTypeItem"
|
||||
bg-color="#ffffff" active-color="#e54d42" v-if="storeSwitch == 1"
|
||||
style="border-radius:0;"></u-subsection>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view v-show="typeCurrent === 0 || typeCurrent === 1">
|
||||
<!-- 收货地址信息 -->
|
||||
<view class="u-margin-top-20 u-margin-bottom-20 coreshop-common-view-box" v-if="userShip && userShip.id" @click="showAddressList">
|
||||
<view class="u-margin-top-20 u-margin-bottom-20 coreshop-common-view-box"
|
||||
v-if="userShip && userShip.id" @click="showAddressList">
|
||||
<view class="coreshop-bg-white coreshop-card address-view">
|
||||
<view class="coreshop-list menu-avatar">
|
||||
<view class="coreshop-list-item">
|
||||
|
|
@ -23,7 +26,9 @@
|
|||
<text class="u-margin-left-20">{{ userShip.mobile || ''}}</text>
|
||||
</view>
|
||||
<view class="coreshop-text-gray u-font-sm flex">
|
||||
<view class="u-line-1">{{ userShip.areaName || ''}} {{userShip.address || ''}}</view>
|
||||
<view class="u-line-1">{{ userShip.areaName || ''}}
|
||||
{{userShip.address || ''}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action coreshop-text-gray">
|
||||
|
|
@ -35,7 +40,8 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="u-margin-top-20 u-margin-bottom-20 coreshop-common-view-box" v-else>
|
||||
<view class="coreshop-bg-white coreshop-card address-view u-text-center u-padding-bottom-30">
|
||||
<view
|
||||
class="coreshop-bg-white coreshop-card address-view u-text-center u-padding-bottom-30">
|
||||
<u-button type="error" size="mini" @click="goAddress()">添加收货地址</u-button>
|
||||
<view class="address-line" />
|
||||
</view>
|
||||
|
|
@ -43,7 +49,8 @@
|
|||
</view>
|
||||
<view v-show="typeCurrent === 2">
|
||||
<!-- 门店信息 -->
|
||||
<view class="u-margin-top-20 u-margin-bottom-20 coreshop-common-view-box" v-if="store && store.id" @click="goStorelist()">
|
||||
<view class="u-margin-top-20 u-margin-bottom-20 coreshop-common-view-box"
|
||||
v-if="store && store.id" @click="goStorelist()">
|
||||
<view class="coreshop-bg-white coreshop-card address-view">
|
||||
<view class="coreshop-list menu-avatar">
|
||||
<view class="coreshop-list-item">
|
||||
|
|
@ -67,7 +74,8 @@
|
|||
<view class="address-line" />
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class='u-margin-top-20 u-margin-bottom-20 coreshop-common-view-box' @click="goStorelist()">
|
||||
<view v-else class='u-margin-top-20 u-margin-bottom-20 coreshop-common-view-box'
|
||||
@click="goStorelist()">
|
||||
<view class="coreshop-bg-white coreshop-card address-view">
|
||||
<view class='u-padding-20 u-text-center'>暂无门店</view>
|
||||
<view class="address-line" />
|
||||
|
|
@ -75,30 +83,39 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='u-margin-top-20 u-margin-bottom-20 coreshop-common-view-box' v-if="storeSwitch == 1 && typeCurrent === 2">
|
||||
<view class='u-margin-top-20 u-margin-bottom-20 coreshop-common-view-box'
|
||||
v-if="storeSwitch == 1 && typeCurrent === 2">
|
||||
<view class="coreshop-form-group">
|
||||
<view class="title">姓名</view>
|
||||
<input class='coreshop-cell-bd-input' placeholder='请输入提货人姓名' v-model="storePick.name" style="width: 100%;"></input>
|
||||
<input class='coreshop-cell-bd-input' placeholder='请输入提货人姓名' v-model="storePick.name"
|
||||
style="width: 100%;"></input>
|
||||
</view>
|
||||
<view class="coreshop-form-group">
|
||||
<view class="title">电话</view>
|
||||
<input class='coreshop-cell-bd-input' placeholder='请输入提货人电话' v-model="storePick.mobile" style="width: 100%;"></input>
|
||||
<input class='coreshop-cell-bd-input' placeholder='请输入提货人电话' v-model="storePick.mobile"
|
||||
style="width: 100%;"></input>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品列表信息 -->
|
||||
<!--商品信息-->
|
||||
<view class="u-margin-top-20 u-margin-bottom-20 coreshop-common-view-box">
|
||||
<view class="coreshop-bg-white coreshop-card goods-view">
|
||||
<view class="goods-info-view-box coreshop-solid-bottom" v-if="item.isSelect == true" v-for="(item, index) in products" :key="index">
|
||||
<view class="coreshop-avatar radius lg" :style="[{backgroundImage:'url('+ item.products.images+'?x-oss-process=image/resize,m_lfit,h_200,w_200' +')'}]" />
|
||||
<view class="goods-info-view-box coreshop-solid-bottom" v-if="item.isSelect == true"
|
||||
v-for="(item, index) in products" :key="index">
|
||||
<view class="coreshop-avatar radius lg"
|
||||
:style="[{backgroundImage:'url('+ item.products.images+'?x-oss-process=image/resize,m_lfit,h_200,w_200' +')'}]" />
|
||||
<view class="goods-info-view">
|
||||
<view class="coreshop-text-black u-line-2">{{ item.products.name || ''}}</view>
|
||||
<view class="u-font-sm coreshop-text-gray" v-if="item.products.spesDesc !== null">{{ item.products.spesDesc || ''}}</view>
|
||||
<view class="u-font-sm coreshop-text-gray" v-if="item.products.spesDesc !== null">
|
||||
{{ item.products.spesDesc || ''}}
|
||||
</view>
|
||||
<view class="coreshop-tag-view" v-if="item.products.promotionList">
|
||||
<u-tag :text="v.name" mode="light" size="mini" v-for="(v, k) in item.products.promotionList" :key="k"/>
|
||||
<u-tag :text="v.name" mode="light" size="mini"
|
||||
v-for="(v, k) in item.products.promotionList" :key="k" />
|
||||
</view>
|
||||
<view class="goods-price-view">
|
||||
<text class="coreshop-text-price coreshop-text-red u-font-lg">{{ item.products.price || ''}}结缘</text>
|
||||
<text
|
||||
class="coreshop-text-price coreshop-text-red u-font-lg">{{ item.products.price || ''}}结缘</text>
|
||||
<view class='u-text-right goods-num'>× {{ item.nums || ''}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -112,18 +129,23 @@
|
|||
<view class="coreshop-bg-white coreshop-card goods-view">
|
||||
<view class="coreshop-text-black coreshop-gift-list">
|
||||
<view class="u-line-1 title">优惠券</view>
|
||||
<u-tag class="u-text-right" text="取消选择" closeable type="error" shape="circle" mode="dark" size="mini" @click="notUseCoupon()" v-if="usedCoupons.length>0" />
|
||||
<u-tag class="u-text-right" text="取消选择" closeable type="error" shape="circle" mode="dark"
|
||||
size="mini" @click="notUseCoupon()" v-if="usedCoupons.length>0" />
|
||||
</view>
|
||||
<!--滑动列表-->
|
||||
<view class="coupon-scroll-box">
|
||||
<scroll-view class="coupon-scroll" scroll-x>
|
||||
<block v-for="(item, index) in userCoupons" :key="index">
|
||||
<view :id="['scroll' + (index + 1 )]" class="coupon-scroll-item u-margin-top-20 flex coreshop-service-view couponBox" @click="couponHandle(index)">
|
||||
<view :id="['scroll' + (index + 1 )]"
|
||||
class="coupon-scroll-item u-margin-top-20 flex coreshop-service-view couponBox"
|
||||
@click="couponHandle(index)">
|
||||
<view class="flex-sub bg-page u-padding-20 u-margin-10 radius ">
|
||||
<view class="coreshop-text-black u-line-1">{{ item.couponName || ''}}</view>
|
||||
<view class="coreshop-text-gray u-font-sm u-line-1"> {{ item.expression2 }}</view>
|
||||
<view class="coreshop-text-gray u-font-sm u-line-1"> {{ item.expression2 }}
|
||||
</view>
|
||||
<view class="coreshop-text-black">
|
||||
<text class="line-red u-font-20 radius">有效期:{{ item.stime + ' 至 ' + item.etime }}</text>
|
||||
<text
|
||||
class="line-red u-font-20 radius">有效期:{{ item.stime + ' 至 ' + item.etime }}</text>
|
||||
</view>
|
||||
<view v-if="!item.checked && item.disabled">
|
||||
<view class="coreshop-corner-mark" />
|
||||
|
|
@ -179,7 +201,8 @@
|
|||
|
||||
<view class="coreshop-text-black item-view">
|
||||
<view class="u-line-1 title">商品总结缘</view>
|
||||
<text class="coreshop-text-red coreshop-text-price u-text-right">{{ cartData.goodsAmount }}结缘</text>
|
||||
<text
|
||||
class="coreshop-text-red coreshop-text-price u-text-right">{{ cartData.goodsAmount }}结缘</text>
|
||||
</view>
|
||||
|
||||
<!-- <view class="coreshop-text-black item-view">
|
||||
|
|
@ -226,9 +249,11 @@
|
|||
<view class="u-flex u-flex-nowrap u-row-between u-padding-20 w100">
|
||||
<view class="coreshop-text-black coreshop-text-bold price-view">
|
||||
<text class="u-margin-right-20">共 {{ productNums}} 件商品</text>
|
||||
<text>合计<text class="coreshop-text-price coreshop-text-red u-font-lg u-margin-left-20">{{ cartData.amount}}结缘</text></text>
|
||||
<text>合计<text
|
||||
class="coreshop-text-price coreshop-text-red u-font-lg u-margin-left-20">{{ cartData.amount}}结缘</text></text>
|
||||
</view>
|
||||
<u-button size="medium" type="error" @click="toPay" :disabled='submitStatus' :loading='submitStatus'>确认下单</u-button>
|
||||
<u-button size="medium" type="error" @click="toPay" :disabled='submitStatus'
|
||||
:loading='submitStatus'>确认下单</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
|
|
@ -237,7 +262,10 @@
|
|||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { goods, articles } from '@/common/mixins/mixinsHelper.js'
|
||||
import {
|
||||
goods,
|
||||
articles
|
||||
} from '@/common/mixins/mixinsHelper.js'
|
||||
export default {
|
||||
mixins: [goods, articles],
|
||||
data() {
|
||||
|
|
@ -310,7 +338,11 @@
|
|||
}
|
||||
this.params.ids = JSON.parse(cartIds)
|
||||
if (!this.params.ids) {
|
||||
_this.$refs.uToast.show({ title: '获取失败', type: 'error', back: true })
|
||||
_this.$refs.uToast.show({
|
||||
title: '获取失败',
|
||||
type: 'error',
|
||||
back: true
|
||||
})
|
||||
}
|
||||
// 获取用户的默认收货地址信息
|
||||
this.userDefaultShip()
|
||||
|
|
@ -323,11 +355,32 @@
|
|||
|
||||
},
|
||||
onShow() {
|
||||
|
||||
let userShip = this.$store.state.userShip;
|
||||
console.log("22222:==", userShip);
|
||||
try {
|
||||
if (userShip) {
|
||||
|
||||
this.userShip = userShip;
|
||||
this.params.areaId = userShip.areaId;
|
||||
// console.log("22222:==", this.userShip);
|
||||
// // console.log("33333:" , this.params.areaId);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
if (this.userShip == null || this.userShip.id == null || this.userShip.id == 0) {
|
||||
|
||||
var data = uni.getStorageSync("adders_userShip");
|
||||
|
||||
if (data != null && data.id != 0) {
|
||||
this.userShip = data;
|
||||
this.params.areaId = data.areaId;
|
||||
uni.removeStorageSync("adders_userShip")
|
||||
}
|
||||
}
|
||||
|
||||
let userInvoice = this.$store.state.invoice;
|
||||
if (userInvoice) {
|
||||
this.invoice = userInvoice;
|
||||
|
|
@ -421,7 +474,10 @@
|
|||
} else {
|
||||
|
||||
this.$refs.uToast.show({
|
||||
title: res.msg, type: 'error', back: false, callback: function () {
|
||||
title: res.msg,
|
||||
type: 'error',
|
||||
back: false,
|
||||
callback: function() {
|
||||
// 优惠券不可用状态判断
|
||||
// 优惠券号码不存在 15009
|
||||
// 优惠券未开始 15010
|
||||
|
|
@ -609,9 +665,16 @@
|
|||
// 创建订单成功 去支付
|
||||
// 判断是否为0元订单,如果是0元订单直接支付成功
|
||||
if (res.data.payStatus == '2') {
|
||||
this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?orderId=' + res.data.orderId });
|
||||
this.$u.route({
|
||||
type: 'redirectTo',
|
||||
url: '/pages/payment/result/result?orderId=' + res.data.orderId
|
||||
});
|
||||
} else {
|
||||
this.$u.route({ type: 'redirectTo', url: '/pages/payment/pay/pay?orderId=' + res.data.orderId + '&type=' + this.orderType });
|
||||
this.$u.route({
|
||||
type: 'redirectTo',
|
||||
url: '/pages/payment/pay/pay?orderId=' + res.data.orderId + '&type=' + this
|
||||
.orderType
|
||||
});
|
||||
}
|
||||
this.subscription();
|
||||
} else {
|
||||
|
|
@ -633,7 +696,8 @@
|
|||
if (res.errMsg == "requestSubscribeMessage:ok") {
|
||||
console.log(ress);
|
||||
}
|
||||
}, fail(ress) {
|
||||
},
|
||||
fail(ress) {
|
||||
console.log(ress);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user