Commit 77869420 authored by lijiongliang's avatar lijiongliang

加购商品修改

parent f92c0bbc
......@@ -3,7 +3,7 @@
* @Description: 获取挪车码
-->
<template>
<view class="appCotent">
<view class="appCotent">
<div class="getCarCode">
<div class="get__content">
......@@ -36,6 +36,9 @@
<image :src="vo.img" />
</div> -->
<div class="list__money">
<view class="tag">
包邮
</view>
<div class="money__title clamp2">
<text>{{vo.title}}</text>
</div>
......@@ -48,6 +51,7 @@
</div>
</div>
<view class="num-box">
<u-number-box>
<view slot="minus" class="minus" @click="minusMall(vo)">
<u-icon name="minus" size="12"></u-icon>
......@@ -59,6 +63,8 @@
<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
</view>
</u-number-box>
</view>
<!-- <u-number-box v-model="mallSelectMap[vo.id]" :min="0" @change="selectMall">
......@@ -110,11 +116,11 @@
</div>
</div>
</div>
</view>
</view>
</template>
<script>
export default {
export default {
data() {
return {
nums: 0,
......@@ -194,7 +200,7 @@ export default {
}
uni.showLoading({
title: '加载中',
mask:true
mask: true
});
let that = this
let opts = {
......@@ -225,17 +231,24 @@ export default {
package: paymentData.packageValue,
signType: paymentData.signType,
paySign: paymentData.paySign,
success: function (res) {
success: function(res) {
uni.navigateTo({
url: '/pagesC/pages/shop/payOk'
})
},
fail: function (err) {
fail: function(err) {
//console.log('支付失败',err);
if(that.orderSubmit.ids !== undefined && that.orderSubmit.ids !== null && that.orderSubmit.ids.length > 0){
let opts = { url: '/app/mall/cancel/order', method: 'post' }
that.http.httpTokenRequest(opts, {"ids" : that.orderSubmit.ids}).then(res => {
if(res.data.code == 200){
if (that.orderSubmit.ids !== undefined && that
.orderSubmit.ids !== null && that
.orderSubmit.ids.length > 0) {
let opts = {
url: '/app/mall/cancel/order',
method: 'post'
}
that.http.httpTokenRequest(opts, {
"ids": that.orderSubmit.ids
}).then(res => {
if (res.data.code == 200) {
}
})
......@@ -277,7 +290,8 @@ export default {
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.addressList = res.data.data
if (this.addressList !== undefined && this.addressList != null && this.addressList.length > 0) {
if (this.addressList !== undefined && this.addressList != null && this.addressList.length >
0) {
let defaultFlagExist = false
this.addressList.forEach(element => {
if (this.addressId) {
......@@ -285,8 +299,12 @@ export default {
this.addressInfo = element
this.addressShow = true
defaultFlagExist = true
} else {
defaultFlagExist = false
}
} else if (element.defaultFlag) {
return
}
if (element.defaultFlag) {
this.addressInfo = element
this.addressId = element.id
this.addressShow = true
......@@ -294,9 +312,12 @@ export default {
}
});
if (!defaultFlagExist) {
this.addressInfo = this.addressList[0]
this.addressInfo = this.addressList[this.addressList.length - 1]
this.addressShow = true
}
} else if (this.addressList.length == 0) {
this.addressInfo = null
this.addressShow = false
}
}
})
......@@ -369,11 +390,11 @@ export default {
onLoad(option) {
this.carNo = option.carNo
},
};
};
</script>
<style lang="scss" scoped>
.getCarCode {
.getCarCode {
/deep/ .u-modal__content__text {
text-align: center !important;
}
......@@ -466,6 +487,7 @@ export default {
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.16);
border-radius: 40rpx;
border: 1rpx solid #ffeddc;
.address__left {
width: 600rpx;
......@@ -481,9 +503,11 @@ export default {
.right__phone {
display: flex;
align-items: center;
span{
span {
padding-left: 20rpx;
}
span:nth-of-type(1) {
font-size: 24rpx;
......@@ -544,7 +568,8 @@ export default {
margin-right: 20rpx;
}
}
.fiexd_foot{
.fiexd_foot {
position: fixed;
left: 0;
bottom: 114rpx;
......@@ -592,6 +617,7 @@ export default {
color: #666666;
line-height: 42rpx;
}
}
.money__num {
......@@ -664,6 +690,7 @@ export default {
margin: 0 20rpx;
margin-left: 100rpx;
width: 400rpx;
position: relative;
.money__title {
font-size: 32rpx;
......@@ -680,6 +707,7 @@ export default {
color: #666666;
line-height: 42rpx;
}
}
.money__num {
......@@ -700,6 +728,25 @@ export default {
line-height: 42rpx;
}
}
.tag {
position: absolute;
top: 4rpx;
right: -80rpx;
font-size: 24rpx;
background-color: #F88D28;
color: #fff;
width: 60rpx;
line-height: 40rpx;
text-align: center;
border-radius: 6rpx;
}
}
.num-box{
position: relative;
bottom:-40rpx;
}
.list__add {
......@@ -718,9 +765,9 @@ export default {
}
}
}
}
}
.minus {
.minus {
width: 22px;
height: 22px;
background: #e6e6e6;
......@@ -729,13 +776,13 @@ export default {
color: #fff;
justify-content: center;
align-items: center;
}
}
.input {
.input {
padding: 0 10px;
}
}
.plus {
.plus {
width: 22px;
height: 22px;
background-color: #FF0000;
......@@ -745,5 +792,5 @@ export default {
/* #endif */
justify-content: center;
align-items: center;
}
}
</style>
......@@ -3,7 +3,7 @@
* @Description: 新增地址
-->
<template>
<view class="appCotent">
<view class="appCotent">
<div class="addAddress">
<u-gap bgColor="transparent" height="20"></u-gap>
......@@ -13,7 +13,8 @@
<u--input v-model="model1.addressInfo.userName" placeholder="请填写收货人姓名" border="none"></u--input>
</u-form-item>
<u-form-item label="手机号码:" prop="addressInfo.telNumber" borderBottom ref="item1">
<u--input v-model="model1.addressInfo.telNumber" placeholder="请填写收货人手机号码" border="none"></u--input>
<u--input v-model="model1.addressInfo.telNumber" placeholder="请填写收货人手机号码" border="none">
</u--input>
</u-form-item>
<u-form-item label="收货地址:" prop="addressInfo.address" borderBottom ref="item1">
<u--input v-model="model1.addressInfo.address" placeholder="点击选择收货地址" border="none"></u--input>
......@@ -27,7 +28,8 @@
</span>
</u-form-item>
<u-form-item label="楼号门牌:" prop="addressInfo.detailInfo" borderBottom ref="item1">
<u--input v-model="model1.addressInfo.detailInfo" placeholder="例如 2栋3单元101室" border="none"></u--input>
<u--input v-model="model1.addressInfo.detailInfo" placeholder="例如 2栋3单元101室" border="none">
</u--input>
</u-form-item>
<u-form-item label="设置默认地址:" prop="addressInfo.name" ref="item1">
<u-switch class="del__address" v-model="model1.value" activeColor="#5ac725"></u-switch>
......@@ -38,14 +40,14 @@
<div class="add__tips">为保证您的商品准确送达,请填写正确的地址!</div>
<div class="love__btn" @click="addAddress">
<image src="@/static/move-car/love-car5.png">
新增地址
保存地址
</div>
</div>
</view>
</view>
</template>
<script>
export default {
export default {
data() {
return {
carNumber: "",
......@@ -94,10 +96,23 @@ export default {
trigger: ["blur", "change"],
},
},
type: null
};
},
onLoad(e) {
this.type = e.type
},
methods: {
goBack() {
if (this.type == "myAddress") {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 3]
prevPage.$vm.addressId = -1;
uni.navigateBack({
delta: 2
})
return;
}
uni.navigateBack({
delta: 1
})
......@@ -136,7 +151,7 @@ export default {
uni.showModal({
title: '温馨提示',
content: '无法获取当前位置,请手动开启授权',
success: function (res) {
success: function(res) {
if (res.confirm) {
//console.log('用户点击确定')
uni.openSetting({
......@@ -206,13 +221,14 @@ export default {
// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
this.$refs.form1.setRules(this.rules)
},
};
};
</script>
<style lang="scss" scoped>
.addAddress {
.addAddress {
.app__gps {
padding-left: 20rpx;
image {
width: 34rpx;
height: 36rpx;
......@@ -248,7 +264,7 @@ export default {
height: 30rpx;
margin-right: 20rpx;
position: relative;
top:4rpx;
top: 4rpx;
}
}
......@@ -277,5 +293,5 @@ export default {
}
}
}
}
</style>
......@@ -40,7 +40,7 @@ export default {
methods: {
add() {
uni.navigateTo({
url: '/pagesD/pages/personal/addAddress'
url: '/pagesD/pages/personal/addAddress?type=myAddress'
});
},
getAddressList(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment