Kaynağa Gözat

commit - m 运费

zhengjinyi 1 yıl önce
ebeveyn
işleme
753aaa3365

+ 269 - 279
pages/user/order/components/cm-freight-popup.vue

@@ -1,307 +1,297 @@
 <template>
-    <view class="freight">
-        <view class="freight-switch">
-            <view class="freight-switch-title">运费</view>
-            <view class="freight-switch-fee" v-if="postAgeFlag(0)"><text>包邮</text></view>
-            <view class="freight-switch-fee" v-if="postAgeFlag(1)">
-                <text>{{ freightText }}</text>
-                <text
-                    class="cell-more iconfont icon-xiangyou"
-                    @click="showPopup"
-                ></text>
-            </view>
-            <view class="freight-switch-fee" v-if="postAgeFlag(2)"><text>到付</text></view>
-        </view>
-        <tui-bottom-popup :radius="true" :show="popupShow">
-            <view class="freight-title">运费设置</view>
-            <view class="freight-content">
-                <radio-group @change="radioChange" v-if="designatedFlag()">
-                    <label v-for="(item, index) in radioItems" :key="index">
-                        <radio
-                            style="transform:scale(0.7)"
-                            color="#F3B574"
-                            :id="item.name"
-                            :value="item.name"
-                            :checked="item.checked"
-                        ></radio>
-                        <label :for="item.name" class="label">
-                            <text>{{ item.value }}</text>
-                        </label>
-                    </label>
-                </radio-group>
-                <view class="freight-form">
-                    <view class="freight-form-item" v-if="infoData.designatedFlag !== 2 && infoData.coldChain > 0">
-                        <view>冷链运输费</view>
-                        <view style="position: relative;">
-                            ¥{{ this.infoData.coldChain.toFixed(2) }}
-                            <radio
-                                class="freight-pay"
-                                color="#F3B574"
-                                @click="coldChainChange"
-                                :checked="isCheck"
-                            ></radio>
-                        </view>
-                    </view>
-                    <block v-if="newPostAge() !== 0">
-                        <view class="freight-form-item" v-if="isCPay">
-                            <view>其他运费</view>
-                            <view>{{ '¥' + postAge().toFixed(2) }}</view>
-                        </view>
-                        <view class="freight-form-item" v-else>
-                            <view>其他运费</view>
-                            <view>到付</view>
-                        </view>
-                    </block>
-                    <view class="freight-form-item">
-                        <view>总运费</view>
-                        <view style="color: #F94B4B;">
-                            <view style="display: flex;" v-if="allPostage !== 0 || isCPay">
-                                ¥
-                                <count-up
-                                    :num="allPostage.toFixed(2)"
-                                    :width="16"
-                                    :height="40"
-                                    :fontSize="28"
-                                    color="#F94B4B"
-                                ></count-up>
-                            </view>
-                            <text v-else>
-                                到付
-                            </text>
-                        </view>
-                    </view>
-                </view>
-                <view class="freight-btn" @click="fetchPostAge">确定</view>
-            </view>
-        </tui-bottom-popup>
-    </view>
+	<view class="freight">
+		<view class="freight-switch">
+			<view class="freight-switch-title">运费</view>
+			<view class="freight-switch-fee" v-if="postAgeFlag(0)"><text>包邮</text></view>
+			<view class="freight-switch-fee" v-if="postAgeFlag(1)">
+				<text>{{ freightText }}</text> 
+				<text class="cell-more iconfont icon-xiangyou" v-if="infoData.coldChain>0" @click="showPopup"></text>
+			</view>
+			<view class="freight-switch-fee" v-if="postAgeFlag(2)"><text>到付</text></view>
+		</view>
+		<tui-bottom-popup :radius="true" :show="popupShow">
+			<view class="freight-title">运费设置</view>
+			<view class="freight-content">
+				<!-- <radio-group @change="radioChange" v-if="designatedFlag()">
+					<label v-for="(item, index) in radioItems" :key="index">
+						<radio
+							style="transform:scale(0.7)"
+							color="#F3B574"
+							:id="item.name"
+							:value="item.name"
+							:checked="item.checked"
+						/>
+						<label :for="item.name" class="label">
+							<text>{{ item.value }}</text>
+						</label>
+					</label>
+				</radio-group> -->
+				<view class="freight-form">
+					<view class="freight-form-item" v-if="infoData.designatedFlag !== 2 && infoData.coldChain > 0">
+						<view>冷链运输费</view>
+						<view style="position: relative;">
+							¥{{ infoData.coldChain.toFixed(2) }}
+							<radio
+								class="freight-pay"
+								color="#F3B574"
+								@click="coldChainChange"
+								:checked="isCheck"
+							/>
+						</view>
+					</view>
+					<block v-if="newPostAge() !== 0">
+						<view class="freight-form-item" v-if="isCPay">
+							<view>其他运费</view> <view>{{ '¥' + postAge().toFixed(2) }}</view>
+						</view>
+						<view class="freight-form-item" v-else> <view>其他运费</view> <view>到付</view> </view>
+					</block>
+					<view class="freight-form-item">
+						<view>总运费</view>
+						<view style="color: #F94B4B;">
+							<view style="display: flex;" v-if="allPostage !== 0 || isCPay">
+								¥
+								<count-up
+									:num="allPostage.toFixed(2)"
+									:width="16"
+									:height="40"
+									:fontSize="28"
+									color="#F94B4B"
+								/>
+							</view>
+							<text v-else> 到付 </text>
+						</view>
+					</view>
+				</view>
+				<view class="freight-btn" @click="fetchPostAge">确定</view>
+			</view>
+		</tui-bottom-popup>
+	</view>
 </template>
 
 <script>
 import CountUp from './countUp.vue'
 export default {
-    props: {
-        ispopupShow: {
-            type: Boolean,
-            default: () => false
-        },
-        goodsData: {
-            type: Array,
-            default: () => []
-        },
-        goodIndex: {
-            type: Number
-        }
-    },
-    components: {
-        CountUp
-    },
-    data() {
-        return {
-            radioItems: [
-                {
-                    value: '不包邮',
-                    name: '0',
-                    checked: true
-                },
-                {
-                    value: '到付',
-                    name: '1'
-                }
-            ],
-            isCPay: true,
-            isCheck: false,
-            infoData: {},
-            freightText: '',
-            popupShow: false
-        }
-    },
-    watch: {
-        goodsData: {
-            handler(val) {
-                this.initData(val[0])
-            },
-            deep: true,
-            immediate: true
-        }
-    },
-    computed: {
-        // 总运费
-        allPostage() {
-            this.freightText =
-                (this.postAge() + (this.isCheck ? this.infoData.coldChain : 0) === 0) && !this.isCPay
-                    ? '到付'
-                    : '¥' + (this.postAge() + (this.isCheck ? this.infoData.coldChain : 0)).toFixed(2)
-            return this.postAge() + (this.infoData.isColdChina ? this.infoData.coldChain : 0)
-        },
-        // 合计
-        allPrice() {
-            return Number(this.infoData.originalPrice) + Number(!this.isCPay ? 0 : this.allPostage)
-        }
-    },
-    mounted() {
-    },
-    methods: {
-        // 开启弹窗
-        showPopup() {
-            this.popupShow = true
-            this.$emit('showFreight', true)
-        },
-        // 是否到付
-        postAgeFlag(e) {
-            return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postageFlag === e
-        },
-        // 初始运费
-        postAge() {
-            if (this.isCPay) return this.newPostAge()
-            else return 0
-        },
-        // 新运费
-        newPostAge() {
-            return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postage
-        },
-        // 是否运费切换
-        designatedFlag(index) {
-            return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].designatedFlag !== 1
-        },
-        // 按钮切换
-        radioChange($event) {
-            console.log('切换运费')
-            this.isCPay = !this.isCPay
-            this.infoData.isColdChina = this.isCheck
-            this.infoData.postageFlag = this.isCPay ? 1 : 2
-        },
-        // 初始化运费组件
-        initData(data) {
-            this.infoData = JSON.parse(JSON.stringify(data))
-            this.isCheck = this.infoData.isColdChina
-            this.infoFreightText(data)
-        },
-        // 设置运费
-        infoFreightText(data) {
-            switch (data.postageFlag) {
-                case 0:
-                    this.freightText = '包邮'
-                    this.infoData.postage = 0
-                    this.infoData.postageFlag = data.postageFlag
-                    break
-                case 1:
-                    this.freightText = '¥' + (this.infoData.postage + this.infoData.coldChain)
-                    // this.infoData.postage = this.freightText
-                    this.infoData.postageFlag = data.postageFlag
-                    break
-                case 2:
-                    this.freightText = '到付'
-                    this.infoData.postage = 0
-                    this.infoData.postageFlag = data.postageFlag
-                    break
-            }
-        },
-        // 是否选择冷链费
-        coldChainChange() {
-            this.isCheck = !this.isCheck
-            this.freightText = this.isCheck ? this.allPostage : this.infoData.postage
-            this.infoData.isColdChina = this.isCheck
-        },
+	props: {
+		ispopupShow: {
+			type: Boolean,
+			default: () => false
+		},
+		goodsData: {
+			type: Array,
+			default: () => []
+		},
+		goodIndex: {
+			type: Number
+		}
+	},
+	components: {
+		CountUp
+	},
+	data() {
+		return {
+			radioItems: [
+				{
+					value: '不包邮',
+					name: '0',
+					checked: true
+				}
+				//     {
+				//         value: '到付',
+				//         name: '1'
+				//     }
+			],
+			isCPay: true,
+			isCheck: false,
+			infoData: {},
+			freightText: '',
+			popupShow: false
+		}
+	},
+	watch: {
+		goodsData: {
+			handler(val) {
+				this.initData(val[0])
+			},
+			deep: true,
+			immediate: true
+		}
+	},
+	computed: {
+		// 总运费
+		allPostage() {
+			this.freightText =
+				this.postAge() + (this.isCheck ? this.infoData.coldChain : 0) === 0 && !this.isCPay
+					? '到付'
+					: '¥' + (this.postAge() + (this.isCheck ? this.infoData.coldChain : 0)).toFixed(2)
+			return this.postAge() + (this.infoData.isColdChina ? this.infoData.coldChain : 0)
+		},
+		// 合计
+		allPrice() {
+			return Number(this.infoData.originalPrice) + Number(!this.isCPay ? 0 : this.allPostage)
+		}
+	},
+	mounted() {},
+	methods: {
+		// 开启弹窗
+		showPopup() {
+			this.popupShow = true
+			this.$emit('showFreight', true)
+		},
+		// 是否到付
+		postAgeFlag(e) {
+			return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postageFlag === e
+		},
+		// 初始运费
+		postAge() {
+			if (this.isCPay) return this.newPostAge()
+			else return 0
+		},
+		// 新运费
+		newPostAge() {
+			return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].postage
+		},
+		// 是否运费切换
+		designatedFlag(index) {
+			return JSON.parse(uni.getStorageSync('goodsData'))[this.goodIndex].designatedFlag !== 1
+		},
+		// 按钮切换
+		radioChange($event) {
+			console.log('切换运费')
+			this.isCPay = !this.isCPay
+			this.infoData.isColdChina = this.isCheck
+			this.infoData.postageFlag = this.isCPay ? 1 : 2
+		},
+		// 初始化运费组件
+		initData(data) {
+			this.infoData = JSON.parse(JSON.stringify(data))
+			this.isCheck = this.infoData.isColdChina
+			this.infoFreightText(data)
+		},
+		// 设置运费
+		infoFreightText(data) {
+			switch (data.postageFlag) {
+				case 0:
+					this.freightText = '包邮'
+					this.infoData.postage = 0
+					this.infoData.postageFlag = data.postageFlag
+					break
+				case 1:
+					this.freightText = '¥' + (this.infoData.postage + this.infoData.coldChain)
+					// this.infoData.postage = this.freightText
+					this.infoData.postageFlag = data.postageFlag
+					break
+				case 2:
+					this.freightText = '到付'
+					this.infoData.postage = 0
+					this.infoData.postageFlag = data.postageFlag
+					break
+			}
+		},
+		// 是否选择冷链费
+		coldChainChange() {
+			this.isCheck = !this.isCheck
+			this.freightText = this.isCheck ? this.allPostage : this.infoData.postage
+			this.infoData.isColdChina = this.isCheck
+		},
 
-        // 运费参数
-        fetchPostAge() {
-            this.$emit('changeFreight', [this.goodIndex, this.infoData, this.allPostage])
-            this.popupShow = false
-            this.$emit('showFreight', false)
-        }
-    }
+		// 运费参数
+		fetchPostAge() {
+			this.$emit('changeFreight', [this.goodIndex, this.infoData, this.allPostage])
+			this.popupShow = false
+			this.$emit('showFreight', false)
+		}
+	}
 }
 </script>
 
 <style lang="scss" scoped>
 .freight {
-    position: relative;
+	position: relative;
 }
 .freight-switch {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    width: 100%;
-    box-sizing: border-box;
-    background-color: white;
-    padding: 24rpx 0;
-    .freight-switch-title {
-        color: #333333;
-        font-size: 28rpx;
-        font-weight: bold;
-    }
-    .freight-switch-fee {
-        color: #333333;
-        font-size: 28rpx;
-    }
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	width: 100%;
+	box-sizing: border-box;
+	background-color: white;
+	padding: 24rpx 0;
+	.freight-switch-title {
+		color: #333333;
+		font-size: 28rpx;
+		font-weight: bold;
+	}
+	.freight-switch-fee {
+		color: #333333;
+		font-size: 28rpx;
+	}
 }
 .all-price {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    flex-direction: row-reverse;
-    width: 100%;
-    padding-bottom: 24rpx;
-    font-size: 28rpx;
-    background-color: #ffffff;
-    box-sizing: border-box;
-    .all-price-content {
-        display: flex;
-    }
-    .price {
-        color: #f94b4b;
-    }
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	flex-direction: row-reverse;
+	width: 100%;
+	padding-bottom: 24rpx;
+	font-size: 28rpx;
+	background-color: #ffffff;
+	box-sizing: border-box;
+	.all-price-content {
+		display: flex;
+	}
+	.price {
+		color: #f94b4b;
+	}
 }
 .iconfont {
-    font-size: 32rpx !important;
-    margin-left: 15rpx;
+	font-size: 32rpx !important;
+	margin-left: 15rpx;
 }
 .freight-title {
-    color: #333333;
-    font-size: 32rpx;
-    text-align: center;
-    margin: 50rpx 0 80rpx 0;
+	color: #333333;
+	font-size: 32rpx;
+	text-align: center;
+	margin: 50rpx 0 80rpx 0;
 }
 .freight-content {
-    box-sizing: border-box;
-    padding: 0 50rpx;
-    radio {
-        margin-right: 8rpx;
-    }
-    .label {
-        color: #666666;
-        font-size: 28rpx;
-        margin-right: 102rpx;
-    }
-    .freight-btn {
-        height: 90rpx;
-        background: #f3b574;
-        border-radius: 45rpx 45rpx 45rpx 45rpx;
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        color: #ffffff;
-        width: 100%;
-        margin: 100rpx 0 0 0;
-    }
+	box-sizing: border-box;
+	padding: 0 50rpx;
+	radio {
+		margin-right: 8rpx;
+	}
+	.label {
+		color: #666666;
+		font-size: 28rpx;
+		margin-right: 102rpx;
+	}
+	.freight-btn {
+		height: 90rpx;
+		background: #f3b574;
+		border-radius: 45rpx 45rpx 45rpx 45rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		color: #ffffff;
+		width: 100%;
+		margin: 100rpx 0 0 0;
+	}
 }
 .freight-form {
-    margin-top: 50rpx;
-    width: 100%;
-    .freight-form-item {
-        width: 95%;
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
-        margin-bottom: 24rpx;
-        color: #666666;
-        font-size: 28rpx;
-    }
+	margin-top: 50rpx;
+	width: 100%;
+	.freight-form-item {
+		width: 95%;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		margin-bottom: 24rpx;
+		color: #666666;
+		font-size: 28rpx;
+	}
 }
 .freight-pay {
-    position: absolute;
-    right: -60%;
-    transform: scale(0.7);
+	position: absolute;
+	right: -60%;
+	transform: scale(0.7);
 }
 </style>

+ 315 - 318
pages/user/order/components/cm-goods-temp.vue

@@ -1,334 +1,331 @@
 <template name="goods">
-    <view class="goods-template">
-        <!-- 商品列表 -->
-        <view class="goods-list">
-            <view v-for="(item, index) in goodsCloneData" :key="index" class="goods-item">
-                <view class="shoptitle">
-                    <view class="title-text">{{ item.shopName }}</view>
-                </view>
-                <view class="productlist" v-for="(pros, idx) in item.cartList" :key="idx">
-                    <view class="goods-pros-t">
-                        <view class="pros-img"><image :src="pros.image" alt="" /></view>
-                        <view class="pros-product">
-                            <view class="producttitle">{{ pros.name }}</view>
-                            <view class="productspec" v-if="pros.productCategory != 2">规格:{{ pros.unit }}</view>
-                            <!-- 					<view class="productspec" v-if="pros.productCode!=''&&pros.productCode!=null">
+	<view class="goods-template">
+		<!-- 商品列表 -->
+		<view class="goods-list">
+			<view v-for="(item, index) in goodsCloneData" :key="index" class="goods-item">
+				<view class="shoptitle">
+					<view class="title-text">{{ item.shopName }}</view>
+				</view>
+				<view class="productlist" v-for="(pros, idx) in item.cartList" :key="idx">
+					<view class="goods-pros-t">
+						<view class="pros-img"><image :src="pros.image" alt=""/></view>
+						<view class="pros-product">
+							<view class="producttitle">{{ pros.name }}</view>
+							<view class="productspec" v-if="pros.productCategory != 2">规格:{{ pros.unit }}</view>
+							<!-- 					<view class="productspec" v-if="pros.productCode!=''&&pros.productCode!=null">
 								<view >商品编码:{{pros.productCode}}</view>
 							</view> -->
-                            <view class="productprice">
-                                <view class="price">
-                                    <text>¥{{ pros.price | NumFormat }}</text>
-                                </view>
-                                <view class="count">
-                                    <text class="small">x</text>
-                                    {{ pros.number }}
-                                </view>
-                            </view>
-                        </view>
-                    </view>
-                </view>
-                <view class="goods-pros-m">
-                    <view class="m-text">留言:</view>
-                    <view class="m-input">
-                        <input
-                            type="text"
-                            v-model="remark[index]"
-                            @change="changeHandle(index)"
-                            placeholder-class="placeholder"
-                            maxlength="50"
-                            placeholder="选填,最多不超过50个汉字"
-                        />
-                    </view>
-                </view>
-                <cm-freight-popup
-                    ref="freight"
-                    :goodIndex="index"
-                    :goodsData="[item]"
-                    :ispopupShow="ispopupShow"
-                    @show-freight="showFreight"
-                    @change-freight="changeFreight"
-                />
-                <view class="goods-pros-b">
-                    <view class="sum">
-                        <text>合计:</text>
-                        <text class="money">¥</text>
-                        <count-up
-                            :num="item.totalPrice.toFixed(2)"
-                            :width="16"
-                            :height="40"
-                            :fontSize="28"
-                            color="#F94B4B"
-                        ></count-up>
-                    </view>
-                </view>
-            </view>
-        </view>
-    </view>
+							<view class="productprice">
+								<view class="price">
+									<text>¥{{ pros.price | NumFormat }}</text>
+								</view>
+								<view class="count"> <text class="small">x</text> {{ pros.number }} </view>
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="goods-pros-m">
+					<view class="m-text">留言:</view>
+					<view class="m-input">
+						<input
+							type="text"
+							v-model="remark[index]"
+							@change="changeHandle(index)"
+							placeholder-class="placeholder"
+							maxlength="50"
+							placeholder="选填,最多不超过50个汉字"
+						/>
+					</view>
+				</view>
+				<cm-freight-popup
+					ref="freight"
+					:goodIndex="index"
+					:goodsData="[item]"
+					:ispopupShow="ispopupShow"
+					@show-freight="showFreight"
+					@change-freight="changeFreight"
+				/>
+				<view class="goods-pros-b">
+					<view class="sum">
+						<text>合计:</text> <text class="money">¥</text>
+						<count-up
+							:num="item.totalPrice.toFixed(2)"
+							:width="16"
+							:height="40"
+							:fontSize="28"
+							color="#F94B4B"
+						></count-up>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
 </template>
 
 <script>
 import cmFreightPopup from './cm-freight-popup.vue'
 import CountUp from './countUp.vue'
 export default {
-    name: 'goods',
-    props: {
-        goodsData: {
-            type: Array
-        }
-    },
-    components: {
-        cmFreightPopup,
-        CountUp
-    },
-    data() {
-        return {
-            remark: [],
-            vipFlag: 0,
-            ispopupShow: false, // 运费选择弹窗
-            allPrice: 0,
-            goodsCloneData: []
-        }
-    },
-    created() {},
-    filters: {
-        NumFormat(value) {
-            //处理金额
-            return Number(value).toFixed(2)
-        }
-    },
-    watch: {
-        goodsData: {
-            handler: function(el) {
-                //监听对象的变换使用 function,箭头函数容易出现this指向不正确
-                this.goodsCloneData = el
-            },
-            deep: true,
-            immediate: true
-        }
-    },
-    computed: {},
-    methods: {
-        PromotionsFormat(promo) {
-            //促销活动类型数据处理
-            if (promo != null) {
-                if (promo.type == 1 && promo.mode == 1) {
-                    return true
-                } else {
-                    return false
-                }
-            }
-            return false
-        },
-        changeHandle(index) {
-            //输入框的值被改变后
-            this.goodsData[index].note = this.remark[index]
-            this.$emit('handleGoodList', this.goodsData)
-        },
-        showFreight($event) {
-            this.ispopupShow = $event
-        },
-        // 修改运费弹窗
-        changeFreight($event) {
-            this.goodsCloneData[$event[0]] = $event[1]
-            this.goodsCloneData[$event[0]].totalPrice = this.goodsCloneData[$event[0]].originalPrice + $event[2]
-            this.goodsCloneData[$event[0]].postage = $event[1].postageFlag === 2 ? 0 : JSON.parse(uni.getStorageSync('goodsData'))[$event[0]].postage
-            this.$emit('handleGoodList', this.goodsCloneData)
-            console.log('goodsCloneData', this.goodsCloneData)
-        }
-    }
+	name: 'goods',
+	props: {
+		goodsData: {
+			type: Array
+		}
+	},
+	components: {
+		cmFreightPopup,
+		CountUp
+	},
+	data() {
+		return {
+			remark: [],
+			vipFlag: 0,
+			ispopupShow: false, // 运费选择弹窗
+			allPrice: 0,
+			goodsCloneData: []
+		}
+	},
+	created() {},
+	filters: {
+		NumFormat(value) {
+			//处理金额
+			return Number(value).toFixed(2)
+		}
+	},
+	watch: {
+		goodsData: {
+			handler: function(el) {
+				//监听对象的变换使用 function,箭头函数容易出现this指向不正确
+				this.goodsCloneData = el
+			},
+			deep: true,
+			immediate: true
+		}
+	},
+	computed: {},
+	methods: {
+		PromotionsFormat(promo) {
+			//促销活动类型数据处理
+			if (promo != null) {
+				if (promo.type == 1 && promo.mode == 1) {
+					return true
+				} else {
+					return false
+				}
+			}
+			return false
+		},
+		changeHandle(index) {
+			//输入框的值被改变后
+			this.goodsData[index].note = this.remark[index]
+			this.$emit('handleGoodList', this.goodsData)
+		},
+		showFreight($event) {
+			this.ispopupShow = $event
+		},
+		// 修改运费弹窗
+		changeFreight($event) {
+			this.goodsCloneData[$event[0]] = $event[1]
+			this.goodsCloneData[$event[0]].totalPrice = this.goodsCloneData[$event[0]].originalPrice + $event[2]
+			this.goodsCloneData[$event[0]].postage =
+				$event[1].postageFlag === 2 ? 0 : JSON.parse(uni.getStorageSync('goodsData'))[$event[0]].postage
+			this.$emit('handleGoodList', this.goodsCloneData)
+			console.log('goodsCloneData', this.goodsCloneData)
+		}
+	}
 }
 </script>
 
 <style lang="scss">
 .goods-template {
-    width: 100%;
-    height: auto;
-    background: #ffffff;
-    float: left;
-    margin-top: 24rpx;
-    .goods-list {
-        width: 100%;
-        height: auto;
-        background: #f7f7f7;
-        .goods-item {
-            width: 702rpx;
-            padding: 0 24rpx;
-            background: #ffffff;
-            margin-bottom: 24rpx;
-            &:last-child {
-                margin-bottom: 0;
-            }
-        }
-        .shoptitle {
-            display: flex;
-            align-items: center;
-            height: 80rpx;
-            line-height: 80rpx;
-            .title-text {
-                width: 400rpx;
-                overflow: hidden;
-                text-overflow: ellipsis;
-                white-space: nowrap;
-                float: left;
-                font-size: $font-size-28;
-                color: $text-color;
-                text-align: left;
-                line-height: 56rpx;
-                font-weight: bold;
-            }
-        }
-        .productlist {
-            width: 100%;
-            height: auto;
-        }
-        .goods-pros-t {
-            display: flex;
-            width: 100%;
-            height: auto;
-            padding: 12rpx 0;
-            .pros-img {
-                width: 210rpx;
-                height: 100%;
-                border-radius: 10rpx;
-                margin: 0 26rpx 0 0;
-                position: relative;
-                image {
-                    width: 210rpx;
-                    height: 210rpx;
-                    border-radius: 10rpx;
-                    border: 1px solid #f3f3f3;
-                }
-            }
-        }
-        .pros-product {
-            width: 468rpx;
-            height: 100%;
-            line-height: 40rpx;
-            font-size: $font-size-26;
-            position: relative;
-            .producttitle {
-                width: 100%;
-                display: inline-block;
-                height: auto;
-                text-overflow: ellipsis;
-                display: -webkit-box;
-                word-break: break-all;
-                -webkit-box-orient: vertical;
-                -webkit-line-clamp: 2;
-                overflow: hidden;
-                margin-bottom: 8rpx;
-            }
-            .productspec {
-                color: #999999;
-                text-overflow: ellipsis;
-                display: -webkit-box;
-                word-break: break-all;
-                -webkit-box-orient: vertical;
-                -webkit-line-clamp: 1;
-                overflow: hidden;
-                margin: 8rpx 0 24rpx 0;
-            }
-            .productprice {
-                height: 54rpx;
-                width: 100%;
-                float: left;
-                .price {
-                    line-height: 54rpx;
-                    font-size: $font-size-28;
-                    width: 48%;
-                    color: #ff2a2a;
-                    float: left;
-                }
-                .count {
-                    height: 100%;
-                    float: right;
-                    position: relative;
-                    .small {
-                        color: #666666;
-                    }
-                }
-            }
-        }
-        .goods-pros-m {
-            height: 76rpx;
-            line-height: 76rpx;
-            font-size: $font-size-26;
-            color: $text-color;
-            margin-top: 12rpx;
-            .m-text {
-                width: 62rpx;
-                float: left;
-                padding-right: 20rpx;
-                font-weight: bold;
-            }
-            .m-input {
-                display: -webkit-box;
-                display: -webkit-flex;
-                display: flex;
-                -webkit-box-align: center;
-                -webkit-align-items: center;
-                align-items: center;
-                position: relative;
-                width: 580rpx;
-                height: 36rpx;
-                padding: 20rpx;
-                background: #f7f7f7;
-                border-radius: 10rpx;
-                input {
-                    width: 100%;
-                    height: 100%;
-                    background: #f7f7f7;
-                    font-size: $font-size-26;
-                    line-height: 36rpx;
-                    color: #333333;
-                    min-height: 36rpx;
-                }
-            }
-        }
-        .goods-pros-b {
-            width: 100%;
-            height: auto;
-            padding: 10rpx 0;
-            .sum-none {
-                width: 100%;
-                height: 48rpx;
-                line-height: 48rpx;
-                color: $text-color;
-                float: left;
-                text-align: right;
-                .money {
-                    font-size: $font-size-26;
-                    color: #999999;
-                    text-decoration: line-through;
-                }
-                .money-sign {
-                    font-size: $font-size-26;
-                    color: #999999;
-                    text-decoration: line-through;
-                }
-                .money-reduced {
-                    margin-left: 10rpx;
-                    font-size: $font-size-26;
-                    color: $color-system;
-                    .iconfont {
-                        font-size: $font-size-34;
-                    }
-                }
-            }
-            .sum {
-                width: 100%;
-                height: 48rpx;
-                font-size: $font-size-28;
-                line-height: 48rpx;
-                color: $text-color;
-                display: flex;
-                justify-content: flex-end;
-                .money {
-                    color: #ff2a2a;
-                    font-size: $font-size-28;
-                }
-            }
-        }
-    }
+	width: 100%;
+	height: auto;
+	background: #ffffff;
+	float: left;
+	margin-top: 24rpx;
+	.goods-list {
+		width: 100%;
+		height: auto;
+		background: #f7f7f7;
+		.goods-item {
+			width: 702rpx;
+			padding: 0 24rpx;
+			background: #ffffff;
+			margin-bottom: 24rpx;
+			&:last-child {
+				margin-bottom: 0;
+			}
+		}
+		.shoptitle {
+			display: flex;
+			align-items: center;
+			height: 80rpx;
+			line-height: 80rpx;
+			.title-text {
+				width: 400rpx;
+				overflow: hidden;
+				text-overflow: ellipsis;
+				white-space: nowrap;
+				float: left;
+				font-size: $font-size-28;
+				color: $text-color;
+				text-align: left;
+				line-height: 56rpx;
+				font-weight: bold;
+			}
+		}
+		.productlist {
+			width: 100%;
+			height: auto;
+		}
+		.goods-pros-t {
+			display: flex;
+			width: 100%;
+			height: auto;
+			padding: 12rpx 0;
+			.pros-img {
+				width: 210rpx;
+				height: 100%;
+				border-radius: 10rpx;
+				margin: 0 26rpx 0 0;
+				position: relative;
+				image {
+					width: 210rpx;
+					height: 210rpx;
+					border-radius: 10rpx;
+					border: 1px solid #f3f3f3;
+				}
+			}
+		}
+		.pros-product {
+			width: 468rpx;
+			height: 100%;
+			line-height: 40rpx;
+			font-size: $font-size-26;
+			position: relative;
+			.producttitle {
+				width: 100%;
+				display: inline-block;
+				height: auto;
+				text-overflow: ellipsis;
+				display: -webkit-box;
+				word-break: break-all;
+				-webkit-box-orient: vertical;
+				-webkit-line-clamp: 2;
+				overflow: hidden;
+				margin-bottom: 8rpx;
+			}
+			.productspec {
+				color: #999999;
+				text-overflow: ellipsis;
+				display: -webkit-box;
+				word-break: break-all;
+				-webkit-box-orient: vertical;
+				-webkit-line-clamp: 1;
+				overflow: hidden;
+				margin: 8rpx 0 24rpx 0;
+			}
+			.productprice {
+				height: 54rpx;
+				width: 100%;
+				float: left;
+				.price {
+					line-height: 54rpx;
+					font-size: $font-size-28;
+					width: 48%;
+					color: #ff2a2a;
+					float: left;
+				}
+				.count {
+					height: 100%;
+					float: right;
+					position: relative;
+					.small {
+						color: #666666;
+					}
+				}
+			}
+		}
+		.goods-pros-m {
+			height: 76rpx;
+			line-height: 76rpx;
+			font-size: $font-size-26;
+			color: $text-color;
+			margin-top: 12rpx;
+			.m-text {
+				width: 62rpx;
+				float: left;
+				padding-right: 20rpx;
+				font-weight: bold;
+			}
+			.m-input {
+				display: -webkit-box;
+				display: -webkit-flex;
+				display: flex;
+				-webkit-box-align: center;
+				-webkit-align-items: center;
+				align-items: center;
+				position: relative;
+				width: 580rpx;
+				height: 36rpx;
+				padding: 20rpx;
+				background: #f7f7f7;
+				border-radius: 10rpx;
+				input {
+					width: 100%;
+					height: 100%;
+					background: #f7f7f7;
+					font-size: $font-size-26;
+					line-height: 36rpx;
+					color: #333333;
+					min-height: 36rpx;
+				}
+			}
+		}
+		.goods-pros-b {
+			width: 100%;
+			height: auto;
+			padding: 10rpx 0;
+			.sum-none {
+				width: 100%;
+				height: 48rpx;
+				line-height: 48rpx;
+				color: $text-color;
+				float: left;
+				text-align: right;
+				.money {
+					font-size: $font-size-26;
+					color: #999999;
+					text-decoration: line-through;
+				}
+				.money-sign {
+					font-size: $font-size-26;
+					color: #999999;
+					text-decoration: line-through;
+				}
+				.money-reduced {
+					margin-left: 10rpx;
+					font-size: $font-size-26;
+					color: $color-system;
+					.iconfont {
+						font-size: $font-size-34;
+					}
+				}
+			}
+			.sum {
+				width: 100%;
+				height: 48rpx;
+				font-size: $font-size-28;
+				line-height: 48rpx;
+				color: $text-color;
+				display: flex;
+				justify-content: flex-end;
+				.money {
+					color: #ff2a2a;
+					font-size: $font-size-28;
+				}
+			}
+		}
+	}
 }
 </style>

+ 35 - 30
pages/user/order/create-order.vue

@@ -83,20 +83,20 @@ export default {
                 productId: 0, // 商品Id
                 source: 2, // 来源:1WWW 2小程序
                 userId: 0 ,// 用户Id
-                townId: '', // 区域id
+                cityId: '', // 区域id
             },
             supportParm: {
                 // 组合商品立即购买确认订单参数
                 productInfo: '',
                 source: 2, // 来源:1WWW 2小程序
                 userId: 0 ,// 用户Id
-                townId: '', // 区域id
+                cityId: '', // 区域id
             },
             postageParam: {
                 // 邮费计算参数
                 skuIds: 0, // 商品Id(逗号隔开)
                 userId: 0, // 用户Id
-                townId: 0 // 地区Id
+                cityId: 0 // 地区Id
             },
             confirmParam: {
                 cartType: 1, // 购买类型:(1自主下单, 3协销下单)
@@ -275,9 +275,9 @@ export default {
                     this.isAddress = true
                     this.addressData = {}
                     this.confirmParam.addressId = data.list[0].addressId
-                    this.productParam.townId = data.list[0].townId
-                    this.cartParam.townId = data.list[0].townId
-                    this.supportParm.townId = data.list[0].townId
+                    this.productParam.cityId = data.list[0].cityId
+                    this.cartParam.cityId = data.list[0].cityId
+                    this.supportParm.cityId = data.list[0].cityId
                     this.addressData = data.list[0]
                 }
                 // 根据类型调方法
@@ -323,27 +323,7 @@ export default {
                 this.$util.msg('请先添加收货地址~', 2000)
                 return
             }
-            this.confirmParam.orderInfo = this.goodsCloneData.map(el => {
-                let productInfo = []
-                el.cartList.forEach(pros => {
-                    productInfo.push({
-                        skuId: pros.skuId,
-                        productNum: pros.number,
-                        presentNum: 0,
-                        productType: pros.giftType
-                    })
-                })
-                return {
-                    splitCode: el.splitCode,
-                    shopId: el.shopId,
-                    note: el.note ? el.note : '',
-                    // postage: el.isColdChina ? (el.postage + el.coldChain).toFixed(2) : el.postage.toFixed(2),
-                    postage: el.postage.toFixed(2),
-                    postageFlag: el.postageFlag,
-                    isColdChina: el.isColdChina ? 1 : 0,
-                    productInfo: productInfo
-                }
-            })
+            this.confirmParam.orderInfo = this.hanldeProcessing()
             this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
             this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
             this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
@@ -352,6 +332,31 @@ export default {
             this.isSubLoading = true
             this.hanldeOrderSubmit(this.confirmParam)
         },
+		// 处理数据格式
+		hanldeProcessing() {
+			return this.goodsCloneData.map(el => {
+				let productInfo = []
+				el.cartList.forEach(pros => {
+					productInfo.push({
+						skuId: pros.skuId,
+						productNum: pros.number,
+						presentNum: 0,
+						productType: pros.giftType
+					})
+				})
+				return {
+					splitCode: el.splitCode,
+					shopId: el.shopId,
+					note: el.note ? el.note : '',
+					postage: el.isColdChina
+						? parseInt(el.postage + el.coldChain).toFixed(2)
+						: parseInt(el.postage).toFixed(2),
+					postageFlag: el.postageFlag,
+					isColdChina: el.isColdChina ? 1 : 0,
+					productInfo: productInfo
+				}
+			})
+		},
         async hanldeOrderSubmit(params) {
             // 提交订单
             try {
@@ -436,9 +441,9 @@ export default {
             this.isAddress = true
             let SelectData = uni.getStorageSync('selectAddress')
             this.confirmParam.addressId = SelectData.addressId
-            this.productParam.townId = SelectData.townId
-            this.cartParam.townId = SelectData.townId
-            this.supportParm.townId = SelectData.townId
+            this.productParam.cityId = SelectData.cityId
+            this.cartParam.cityId = SelectData.cityId
+            this.supportParm.cityId = SelectData.cityId
             this.addressData = SelectData
             if (this.storeOptions.type == 1) {
                 //立即都买提交