Commit 43b76cce by LJM

发票

parent 49e40f44
......@@ -150,7 +150,7 @@
}
.page-userAddress-add {
padding: 180rpx 24rpx 100rpx 24rpx;
padding: 180rpx 24rpx 150rpx 24rpx;
.tip {
margin-top: 16rpx;
margin-bottom: 16rpx;
......@@ -166,13 +166,11 @@
.text {
margin-left: 16rpx;
.t1 {
max-width: 560rpx;
text-align: justify;
font-size: 22rpx;
color: #f98119;
}
.t2 {
font-size: 22rpx;
color: #1969f9;
}
}
}
.tab {
......
......@@ -22,16 +22,24 @@
</view>
<view class="p3">{{ item.consignee_province_val }}{{ item.consignee_city_val }}{{ item.consignee_district_val }}{{ item.consignee_address }}</view>
<view class="operate row bothSide verCenter">
<view class="row verCenter">
<view class="default"></view>
<text class="default-text">设为默认</text>
</view>
<template v-if="item.is_default == 1">
<view class="row verCenter default-curr">
<view class="default"></view>
<text class="default-text">默认发票</text>
</view>
</template>
<template v-else>
<view class="row verCenter" @click="setdefault(item.tax_id)">
<view class="default"></view>
<text class="default-text">设为默认</text>
</view>
</template>
<view class="row verCenter">
<navigator class="edit row verCenter" url="/user/invoiceEdit" hover-class="none">
<text class="iconfont icon-bjt"></text>
<text class="tt">编辑</text>
</navigator>
<view class="delete row verCenter">
<view class="delete row verCenter" @click="deleteInvoice(item.tax_id)">
<text class="iconfont icon-del"></text>
<text class="tt">删除</text>
</view>
......@@ -69,6 +77,53 @@ export default {
this.getData();
},
methods: {
/**
* 删除发票
*/
deleteInvoice(tax_id) {
uni.showModal({
title: '',
content: '您确定删除该发票嘛',
success: res => {
if (res.confirm) {
this.request(Api_Url + '/invoice/delete', 'POST', { tax_id: tax_id }, true, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '删除成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
}, 2000);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
/**
* 设置默认地址
* @param {Object} tax_id
*/
setdefault(tax_id) {
this.request(Api_Url + '/invoice/setdefault', 'POST', { tax_id: tax_id }, true, true).then(res => {
if (res.err_code === 0) {
this.getData();
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
getData() {
this.request(Api_Url + '/invoice/lists', 'POST', {}, true, true).then(res => {
if (res.err_code === 0) {
......
......@@ -71,11 +71,15 @@ export default {
this.index = e.detail.value;
this.formParams.intl_code = this.array[e.detail.value];
},
/**
* 设置默认监听
* @param {Object} e
*/
onSwitchChange(e) {
this.formParams.is_default = e.detail.value ? 1 : 0;
},
/**
* 地址监听
* 省市区联动监听
* @param {Object} e
*/
bindMultiPickerColumnChange(e) {
......@@ -102,7 +106,7 @@ export default {
this.$forceUpdate();
},
/**
* 省市区完成
* 省市区选择确定
* @param {Object} e
*/
pickerChange(e) {
......@@ -118,7 +122,7 @@ export default {
*/
getProvince(id = 1) {
console.log('获取省数据id:' + id);
this.request(Api_Url + '/address/pcd', 'POST', { id: id }, true, true).then(res => {
this.request(Api_Url + '/address/pcd', 'POST', { id: id }, false, true).then(res => {
if (res.err_code === 0) {
var arr = [];
for (var key in res.data) {
......@@ -136,7 +140,7 @@ export default {
*/
getCity(id, defaultParms) {
console.log('获取市数据id:' + id);
this.request(Api_Url + '/address/pcd', 'POST', { id: id }, true, true).then(res => {
this.request(Api_Url + '/address/pcd', 'POST', { id: id }, false, true).then(res => {
if (res.err_code === 0) {
var arr = [];
for (var key in res.data) {
......@@ -156,7 +160,7 @@ export default {
*/
getDistrict(id) {
console.log('获取区数据id:' + id);
this.request(Api_Url + '/address/pcd', 'POST', { id: id }, true, true).then(res => {
this.request(Api_Url + '/address/pcd', 'POST', { id: id }, false, true).then(res => {
if (res.err_code === 0) {
var arr = [];
for (var key in res.data) {
......
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 sign in to comment