|
|
@@ -23,10 +23,9 @@
|
|
|
<text>添加收货地址</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
<image class="a-bg" :src="addressImg"></image>
|
|
|
</navigator>
|
|
|
- <navigator v-if="tabCurrentIndex == 1" url="/pages/address/shopList" class="address-section">
|
|
|
+ <navigator v-if="tabCurrentIndex == 1" url="/pages/set/shopList" class="address-section">
|
|
|
<view class="order-content" v-if="shopAddress.name">
|
|
|
<text class="iconfont iconlocation"></text>
|
|
|
<view class="cen">
|
|
|
@@ -39,12 +38,11 @@
|
|
|
<text class="iconfont iconenter"></text>
|
|
|
</view>
|
|
|
<view class="order-content" v-if="!shopAddress.name">
|
|
|
- <text class="addAddress">
|
|
|
+ <view class="addAddress">
|
|
|
<text class="iconfont iconaddition"></text>
|
|
|
<text>添加收货地址</text>
|
|
|
- </text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
-
|
|
|
<image class="a-bg" :src="addressImg"></image>
|
|
|
</navigator>
|
|
|
|
|
|
@@ -60,7 +58,8 @@
|
|
|
<text class="title clamp">{{ ls.productInfo.store_name }}</text>
|
|
|
<text class="spec">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.suk : '默认' }}</text>
|
|
|
<view class="price-box">
|
|
|
- <image src="../../static/icon/iconU1.png" class="imgJf" mode="widthFix"></image><text class="price"> {{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price : ls.productInfo.price }}</text>
|
|
|
+ <image src="../../static/icon/iconU1.png" class="imgJf" mode="widthFix"></image>
|
|
|
+ <text class="price">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price : ls.productInfo.price }}</text>
|
|
|
<text class="number">{{ 'x ' + ls.cart_num + (ls.productInfo.unit_name || '') }}</text>
|
|
|
<!-- <view><text class="price">¥{{lss.price}}</text></view> -->
|
|
|
<!-- <view class="number">
|
|
|
@@ -70,9 +69,18 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+ <view class="yt-list" v-if="tabCurrentIndex == 1">
|
|
|
+ <view class="yt-list-cell b-b">
|
|
|
+ <text class="cell-tit clamp">姓名</text>
|
|
|
+ <input class="desc" type="text" v-model="addressData.real_name" placeholder="请填写提货人姓名" placeholder-class="placeholder" />
|
|
|
+ </view>
|
|
|
+ <view class="yt-list-cell b-b">
|
|
|
+ <text class="cell-tit clamp">手机号</text>
|
|
|
+ <input class="desc" type="text" v-model="addressData.phone" placeholder="请填写手机号码" placeholder-class="placeholder" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<!-- 优惠明细 -->
|
|
|
- <view class="yt-list">
|
|
|
+ <!-- <view class="yt-list">
|
|
|
<view class="yt-list-cell b-b" @click="couponListshow ? toggleMask('show') : ''">
|
|
|
<view class="cell-icon">券</view>
|
|
|
<text class="cell-tit clamp">优惠券</text>
|
|
|
@@ -86,7 +94,7 @@
|
|
|
<text class="cell-tit clamp">商家促销</text>
|
|
|
<text class="cell-tip disabled">满{{ moneyAll.storeFreePostage }}包邮</text>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<!-- 金额明细 -->
|
|
|
<view class="yt-list">
|
|
|
<!-- <view class="yt-list-cell b-b">
|
|
|
@@ -156,8 +164,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { confirm,computedOrderkey,couponsOrder } from '@/api/order.js';
|
|
|
-import { userinfo } from '@/api/user.js';
|
|
|
+import { confirm, computedOrderkey, couponsOrder } from '@/api/order.js';
|
|
|
+import { getUserInfo } from '@/api/user.js';
|
|
|
import { cartAdd } from '@/api/product.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -184,7 +192,10 @@ export default {
|
|
|
couponListshow: false, //是有可以显示优惠券列表
|
|
|
couponChecked: {}, //选中的优惠券
|
|
|
// 收货地址
|
|
|
- addressData: {},
|
|
|
+ addressData: {
|
|
|
+ real_name:'',
|
|
|
+ phone:''
|
|
|
+ },
|
|
|
// 店铺地址
|
|
|
shopAddress: {
|
|
|
name: '',
|
|
|
@@ -270,7 +281,7 @@ export default {
|
|
|
},
|
|
|
// 加载用户基础信息
|
|
|
userinfo() {
|
|
|
- userinfo({}).then(({ data }) => {
|
|
|
+ getUserInfo({}).then(({ data }) => {
|
|
|
this.integralAll = data.integral;
|
|
|
});
|
|
|
},
|
|
|
@@ -283,7 +294,7 @@ export default {
|
|
|
addressId: this.addressData.id //地址编号
|
|
|
})
|
|
|
.then(({ data }) => {
|
|
|
- console.log(data,'111');
|
|
|
+ console.log(data, '111');
|
|
|
this.payType = true;
|
|
|
this.integralShow = true;
|
|
|
// 获取支付金额
|
|
|
@@ -306,14 +317,14 @@ export default {
|
|
|
this.payMoneyNub();
|
|
|
},
|
|
|
// 加载优惠券列表
|
|
|
- couponsOrder(money) {
|
|
|
- couponsOrder({}, money).then(e => {
|
|
|
- if (e.data.length > 0) {
|
|
|
- this.couponListshow = true;
|
|
|
- }
|
|
|
- this.couponList = e.data;
|
|
|
- });
|
|
|
- },
|
|
|
+ // couponsOrder(money) {
|
|
|
+ // couponsOrder({}, money).then(e => {
|
|
|
+ // if (e.data.length > 0) {
|
|
|
+ // this.couponListshow = true;
|
|
|
+ // }
|
|
|
+ // this.couponList = e.data;
|
|
|
+ // });
|
|
|
+ // },
|
|
|
//顶部tab点击
|
|
|
tabClick(index) {
|
|
|
this.tabCurrentIndex = index;
|
|
|
@@ -329,7 +340,7 @@ export default {
|
|
|
},
|
|
|
loadData() {
|
|
|
let obj = this;
|
|
|
- confirm({ cartId: obj.cartId+'' }).then(({ data }) => {
|
|
|
+ confirm({ cartId: obj.cartId + '' }).then(({ data }) => {
|
|
|
obj.addressData = data.addressInfo || {};
|
|
|
obj.shopList = data.cartInfo; //商品列表
|
|
|
obj.moneyAll = data.priceGroup; //金额数据
|
|
|
@@ -337,7 +348,7 @@ export default {
|
|
|
// 计算金额
|
|
|
this.payMoneyNub();
|
|
|
// 加载优惠券
|
|
|
- obj.couponsOrder(data.priceGroup.totalPrice);
|
|
|
+ // obj.couponsOrder(data.priceGroup.totalPrice);
|
|
|
});
|
|
|
},
|
|
|
// 购买数量变化
|
|
|
@@ -354,13 +365,23 @@ export default {
|
|
|
this.$api.msg('积分商品只可单件购买');
|
|
|
return false;
|
|
|
}
|
|
|
- if (!this.addressData.real_name) {
|
|
|
+ if(this.tabCurrentIndex == 1){
|
|
|
+ if (!this.addressData.real_name) {
|
|
|
+ this.$api.msg('请填写姓名');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!this.addressData.phone) {
|
|
|
+ this.$api.msg('请填写手机号');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!this.addressData.real_name && this.tabCurrentIndex == 0) {
|
|
|
this.$api.msg('请选择收货地址');
|
|
|
return false;
|
|
|
}
|
|
|
- let url = '/pages/money/pay?key='+ this.orderKey
|
|
|
- if(this.pinkid){
|
|
|
- url += '&pinkid='+this.pinkid
|
|
|
+ let url = '/pages/money/pay?key=' + this.orderKey + '&addresstype=' + this.tabCurrentIndex;
|
|
|
+ if (this.pinkid) {
|
|
|
+ url += '&pinkid=' + this.pinkid;
|
|
|
}
|
|
|
uni.navigateTo({
|
|
|
url
|
|
|
@@ -535,7 +556,7 @@ page {
|
|
|
font-size: 32rpx;
|
|
|
color: $font-color-dark;
|
|
|
padding-top: 10rpx;
|
|
|
- .imgJf{
|
|
|
+ .imgJf {
|
|
|
width: 23rpx;
|
|
|
}
|
|
|
.price {
|