Commit 77869420 authored by lijiongliang's avatar lijiongliang

加购商品修改

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