Explorar el Código

地址显示、商品名修改、积分支付有运费

MS-IOHQJGHXZHQD\Administrator hace 5 meses
padre
commit
64c3fc726b

+ 7 - 5
src/pages/address/index.vue

@@ -29,8 +29,8 @@
 									<u-radio :name="item.id" shape="square" label="设为常用地址" labelSize="26rpx"></u-radio>
 								</template>
 								<view class="right">
-									<text @click="onEdit(item)">编辑</text>
-									<text @click="onDel(item)">删除</text>
+									<text @click.stop="onEdit(item)">编辑</text>
+									<text @click.stop="onDel(item)">删除</text>
 									<!-- <image src="/static/identify/edit.png" />
 									<image src="/static/identify/delete.png" /> -->
 								</view>
@@ -72,7 +72,6 @@ export default {
 		//商品详情页传过来的id
 		if (query.selectedAddressId) {
 			this.selectedAddressId = query.selectedAddressId
-
 		}
 	},
 	onShow() {
@@ -84,9 +83,12 @@ export default {
 		selectedAddressFun(item) {
 			this.selectedAddressId = item.id
 			let pages = getCurrentPages();
-			let prevPage = pages[pages.length - 2];
+			let prevPage = pages.length >= 2 ? pages[pages.length - 2] : null;
 			// 传参
-			prevPage.$vm.selectedAddressId = this.selectedAddressId;
+			if (prevPage) {
+				// 赋值
+				prevPage.$vm.selectedAddressId = this.selectedAddressId;
+			}
 
 		},
 		// 获取数据

+ 13 - 6
src/points/productDetails/components/selectProduct.vue

@@ -56,7 +56,7 @@
         <view class="specClass">
             <view v-for="arr in specList">
                 <view class="title">{{ arr[0] }} ({{ Array.from(arr[1]).length }})</view>
-                <view style="display: flex;flex-wrap: wrap;">
+                <view class="specWrap">
                     <view class="specCombination" @click="selectedSpecFun(value, arr[0])"
                         :class="selectedObj ? selectedObj.specValueText.indexOf(value) != -1 ? 'active' : '' : ''"
                         v-for="value in Array.from(arr[1])">
@@ -68,7 +68,7 @@
         <!--运费 -->
         <view class="yunFeiClass">
             <view class="text">运费</view>
-            <view class="price" v-if="params">¥{{ params.freight }}</view>
+            <view class="text" :style="{color:params.freight == 0?'#666':'#333'}" v-if="params">{{ params.freight == 0 ? '免运费' :  '¥'+params.freight }}</view>
 
         </view>
         <!--订单备注 -->
@@ -80,7 +80,7 @@
         </view>
         <!--支付方式 -->
         <view v-if="params">
-            <u-radio-group v-if="selectPayMeth && (params.paymentType == 2 || params.paymentType == 3)"
+            <u-radio-group v-if="selectPayMeth && (params.paymentType !== 1 || params.freight>0) "
                 class="nodeClass" v-model="selectPayMeth">
                 <view style="width: 100%;">
                     <view style="display: flex;justify-content: space-between;width: 100%;">
@@ -113,7 +113,7 @@
                 color: '#fff',
                 background: '#03C1B8'
             }">请选择</u-button>
-            <u-button :disabled="redeemNowBtnDisable" v-else-if="selectedObj && selectedObj.stock && params" :customStyle="{
+            <u-button :disabled="redeemNowBtnDisable" v-else-if="selectedObj.stock && params" :customStyle="{
                 color: '#fff',
                 background: '#03C1B8'
             }" @click="redeemNowFun">{{ params.paymentType == 1 ? '立即兑换' : '实付价' }} {{ params.paymentType == 1 ?
@@ -351,6 +351,11 @@ export default {
             font-style: normal;
             text-transform: none;
         }
+        .specWrap{
+            display: flex;
+            flex-wrap: wrap;
+            gap: 16rpx;
+        }
 
         .specCombination {
             font-weight: 500;
@@ -360,10 +365,12 @@ export default {
             font-style: normal;
             text-transform: none;
             height: 56rpx;
+            line-height: 56rpx;
             background: #F0F0F0;
             border-radius: 38rpx 38rpx 38rpx 38rpx;
-            margin-right: 16rpx;
-            padding: 8rpx 16rpx;
+            white-space: nowrap; /* 文字不换行 */
+            //margin-right: 16rpx;
+            padding: 0 16rpx;
             margin-top: 24rpx;
         }
 

+ 8 - 17
src/points/productDetails/index.vue

@@ -64,7 +64,7 @@
             <text style="color: #666666;margin-right: 24rpx;">送至</text>
             <text v-if="defaultAddress"
               style="width: 520rpx;white-space:nowrap;overflow: hidden;text-overflow: ellipsis;">
-              {{ defaultAddress.address }}</text>
+              {{ defaultAddress.address + defaultAddress.atlasAdd }}</text>
             <text v-else style="color: #999;position: absolute;right: 30rpx;">添加收货地址</text>
             <span style="position: absolute;right: 0;top: -3rpx;">
               <image style="width: 35rpx;height: 35rpx;" @click="addressSelectFun"
@@ -73,7 +73,9 @@
           </view>
           <view class="seedAddressClass">
             <text style="color: #666666;margin-right: 24rpx;">发货</text>
-            <text>山西省太原市小店区 | {{ params.freight == 0 ? '免运费' : '运费' + params.freight + '元' }}</text>
+            <text>山西省太原市小店区 
+              <text v-if="params.freight!=undefined"> | {{ params.freight == 0 ? '免运费' : '运费' + params.freight + '元' }}</text>
+            </text>
           </view>
           <view class="promiseSeedTime" style="margin-left: 80rpx;">
             下单后{{ params.deliveryTime }}小时内发货
@@ -203,16 +205,6 @@ export default {
   },
   onShow() {
     this.getAddrListFun()
-
-    //选择地址后传回的地址id
-    // if (this.selectedAddressId && this.defaultAddress) {
-    //   if (this.selectedAddressId !== this.defaultAddress.id) {
-    //     this.defaultAddress = this.addressList.find(item => {
-    //       if (item.id == this.selectedAddressId)
-    //         return item
-    //     });
-    //   }
-    // }
   },
   onPageScroll(e) {
     //console.log("滚动距离为:" + e.scrollTop);
@@ -319,7 +311,7 @@ export default {
       }
 
       if (this.selectedObj) {
-        if (this.selectPayMeth == null && (params.paymentType == 2 || params.paymentType == 3)) {
+        if (this.selectPayMeth == null && (params.paymentType !== 1 || this.params.freight>0)) {
           uni.showToast({
             title: '请选择支付方式',
             icon: 'none'
@@ -345,7 +337,7 @@ export default {
         params.payAmount = this.selectedObj.priceMoney;// 支付金额
         params.pointsUsed = this.selectedObj.pricePoint;// 使用的积分
         params.buyerRemark = this.orderRemarks;//买家备注信息
-        if (params.paymentType == 1) {//只有积分兑换
+        if (this.params.paymentType == 1 && this.params.freight==0) {//只有积分兑换
           this.productOrderCreateFun(params)
           return
         }
@@ -593,12 +585,11 @@ export default {
 
     .discribeClass {
       margin-top: 12rpx;
-      width: 308rpx;
-      height: 28rpx;
+      line-height: 28rpx;
       font-weight: 500;
       font-size: 28rpx;
       color: #999999;
-      line-height: 28rpx;
+      line-height: 32rpx;
       text-align: left;
       font-style: normal;
       text-transform: none;

+ 3 - 4
src/points/productDetails/pendingPayment.vue

@@ -64,7 +64,7 @@
                                 }}</text>
                         </view>
                     </view>
-                    <view class="weiChect">
+                    <view class="weiChect" v-if="productInfo.paymentType !== 1 || orderInfo.freightAmount>0">
                         <view style="display: flex;">
                             <image v-if="orderInfo.payType == '1'" style="width: 40rpx;height: 40rpx;"
                                 src="@/static/points/weiXin.png" mode="">
@@ -277,7 +277,7 @@ export default {
         //去付款
         goPay() {
             this.goPayBtnDisable = true
-            if (this.productInfo.paymentType == 1) {//只有积分兑换
+            if (this.productInfo.paymentType == 1 && this.orderInfo.freightAmount==0) {//只有积分兑换
                 this.productOrderCreateFun()
                 return
             }
@@ -475,9 +475,8 @@ export default {
         height: 56rpx;
         line-height: 56rpx;
         border-radius: 98rpx 98rpx 98rpx 98rpx;
-
         font-size: 26rpx;
-        padding: 0 0 10rpx 0;
+        //padding: 5rpx 0 5rpx 0;
         margin: 0 32rpx 0 0;
     }
 }