diff --git a/common/api/shop.js b/common/api/shop.js index 18abda3..8474ff1 100644 --- a/common/api/shop.js +++ b/common/api/shop.js @@ -1,6 +1,6 @@ export default { init(vm){ - return { + return { // 获取首页轮播 getIndexSwiper() { return vm.$u.post('adv/indexadv'); @@ -139,7 +139,7 @@ export default { }); }, // 订单步骤2:发起订单,返回订单信息 - sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, is_selfraising }) { + sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, is_selfraising, invoice_id }) { return vm.$u.post('buy/buy_step2', { ifcart: ifcart, cart_id: cart_id, @@ -149,6 +149,7 @@ export default { pintuangroup_id: pintuangroup_id, voucher_id: voucher_id, // 优惠券信息 is_selfraising: is_selfraising, // 是否自提 + invoice_id: invoice_id, }); }, // 订单步骤3:发起支付(第三方统一下单) @@ -373,8 +374,11 @@ export default { //内容 tipsinfo({document_code}){ return vm.$u.post('Shop/tipInfo',{document_code}) - } - } + }, + advClick({ adv_id }) { + return vm.$u.post('adv/advClick',{ adv_id }) + }, + } } } \ No newline at end of file diff --git a/common/api/user.js b/common/api/user.js index 29a3f3a..a4c2b39 100644 --- a/common/api/user.js +++ b/common/api/user.js @@ -479,8 +479,26 @@ export default { return vm.$u.post("Expertapply/expertApply", { name, mobile, address, industry, hobby }) - } + }, + getInvoiceList() { + return vm.$u.post("Invoice/invoiceList") + }, + getInvoiceInfo({ invoice_id }) { + return vm.$u.post("Invoice/invoiceInfo", { invoice_id }) + }, + invoiceAdd({ invoice_type, invoice_title, invoice_code, invoice_goto_addr, invoice_rec_mobphone, invoice_reg_bname, invoice_reg_baccount }) { + return vm.$u.post("Invoice/invoiceAdd", { + invoice_type, invoice_title, invoice_code, invoice_goto_addr, invoice_rec_mobphone, invoice_reg_bname, invoice_reg_baccount + }) + }, + invoiceEdit({ invoice_id, invoice_title, invoice_code, invoice_goto_addr, invoice_rec_mobphone, invoice_reg_bname, invoice_reg_baccount, invoice_type }) { + return vm.$u.post("Invoice/invoiceEdit", { + invoice_id, invoice_title, invoice_code, invoice_goto_addr, invoice_rec_mobphone, invoice_reg_bname, invoice_reg_baccount, invoice_type + }) + }, + invoiceDel({ invoice_id }) { + return vm.$u.post("Invoice/invoiceDel", { invoice_id }) + }, } - } } \ No newline at end of file diff --git a/common/store/index.js b/common/store/index.js index 2ab536a..ad1b844 100644 --- a/common/store/index.js +++ b/common/store/index.js @@ -21,6 +21,10 @@ const store = new Vuex.Store({ showLoginModel: false, // 登录框 question: {}, // 帮助与反馈 showCoupons: true, // 是否显示新人领取优惠券 + invoiceInfo: { // 是否选择发票 + invoice_type: '', + invoice_id: 0, + } }, getters: { getOrderAddress(state) { @@ -31,8 +35,15 @@ const store = new Vuex.Store({ }, getGoodsInfo(state) { return state.goodsDetails.goods; + }, + hasInvoice(state) { + const type = state.invoiceInfo.invoice_type; + return type ? type : 0; + }, + getInvoiceId(state) { + return state.invoiceInfo.invoice_id || 0; } - }, + }, mutations: { // 登录 loginIn(state, token) { @@ -83,6 +94,9 @@ const store = new Vuex.Store({ }, updateShowCoupons(state, status) { state.showCoupons = status; + }, + setInvoiceInfo(state, invoice = {}) { + state.invoiceInfo = invoice; } } }) diff --git a/pageC/cart/ConfirmOrder.vue b/pageC/cart/ConfirmOrder.vue index 7b1f129..fd24593 100644 --- a/pageC/cart/ConfirmOrder.vue +++ b/pageC/cart/ConfirmOrder.vue @@ -69,6 +69,14 @@ + + 开具发票 + + 本次不开具发票 + {{ hasInvoice == 1 ? '个人或事业单位发票' : '企业发票' }} + + + @@ -134,6 +142,7 @@ export default { orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单 debounce: true, is_selfraising: 0, // 是否自提:0=》否,1=》是 + hasInvoice: 0, } }, components: { @@ -176,9 +185,12 @@ export default { } else { if(this.$store.getters.getOrderAddress) this.addressInfo = this.$store.state.orderAddress; } + this.hasInvoice = this.$store.getters.hasInvoice; + console.log(this.hasInvoice); }, beforeDestroy() { this.$store.commit('updateAddress', {}); + this.$store.commit('setInvoiceInfo', {}); }, watch: { '$store.state.orderAddress'(value) { @@ -265,6 +277,7 @@ export default { address_id: this.addressInfo.address_id, buy_city_id: this.addressInfo.city_id, is_selfraising: this.is_selfraising, + invoice_id: this.$store.getters.getInvoiceId, // 发票抬头ID,不开票传0 } if(coupon.length) Object.assign(params, { voucher_id: coupon }); if(this.orderType == 2) { @@ -430,7 +443,10 @@ export default { uni.navigateTo({ url: '/pageE/more/Address?type=choose' }); - } + }, + selectInvoice() { + this.$u.route('/pageC/cart/selectInvoice'); + }, }, }; @@ -632,6 +648,9 @@ export default { align-items: center; font-size: 30rpx; color:rgba(51,51,51,1); + .invoice { + font-size: 26rpx; + } > image { width: 12rpx; height: 22rpx; diff --git a/pageC/cart/selectInvoice.vue b/pageC/cart/selectInvoice.vue new file mode 100644 index 0000000..dda72e9 --- /dev/null +++ b/pageC/cart/selectInvoice.vue @@ -0,0 +1,186 @@ + + + \ No newline at end of file diff --git a/pageE/more/EditInvoice.vue b/pageE/more/EditInvoice.vue new file mode 100644 index 0000000..9c6388a --- /dev/null +++ b/pageE/more/EditInvoice.vue @@ -0,0 +1,307 @@ + + + \ No newline at end of file diff --git a/pageE/more/MineInvoice.vue b/pageE/more/MineInvoice.vue new file mode 100644 index 0000000..06c7761 --- /dev/null +++ b/pageE/more/MineInvoice.vue @@ -0,0 +1,123 @@ + + + \ No newline at end of file diff --git a/pages.json b/pages.json index 8da937b..b479026 100644 --- a/pages.json +++ b/pages.json @@ -358,6 +358,19 @@ } } }, + { + "path": "cart/selectInvoice", + "style": { + "navigationBarTitleText": "发票抬头", + "app-plus": { + "titleSize": "36px", + "titleNView": { + "titleColor": "#333333", + "backgroundColor": "#FFFFFF" + } + } + } + }, { "path": "merchant/index", "style": { @@ -635,6 +648,32 @@ } } }, + { + "path": "more/MineInvoice", + "style": { + "navigationBarTitleText": "我的发票", + "app-plus": { + "titleSize": "36px", + "titleNView": { + "titleColor": "#333333", + "backgroundColor": "#FFFFFF" + } + } + } + }, + { + "path": "more/EditInvoice", + "style": { + "navigationBarTitleText": "发票抬头", + "app-plus": { + "titleSize": "36px", + "titleNView": { + "titleColor": "#333333", + "backgroundColor": "#FFFFFF" + } + } + } + }, { "path": "mine/ArticleDetails", "style": { diff --git a/pages/index/index.vue b/pages/index/index.vue index 9f6e93b..a3c95a4 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -549,7 +549,8 @@ // console.log(item); this.jumpPage({ type: item.url_type, - id: item.info_id, + id: item.info_id, + adv_id: item.adv_id, }); }, clickSImage(index) { @@ -557,11 +558,12 @@ // console.log(item); this.jumpPage({ type: item.url_type, - id: item.info_id, + id: item.info_id, + adv_id: item.adv_id, }); }, - goSearch() { - this.$u.route("/pageB/search/index", { + goSearch() { + this.$u.route("/pageB/search/index", { type: 2, curent:2 }); @@ -576,17 +578,18 @@ }) }, onPulling(e) { - console.log("onpulling", e); - }, - onRestore() { - this.refresher = 'restore'; // 需要重置 - console.log("onRestore"); - }, - onAbort() { - console.log("onAbort"); - }, + console.log("onpulling", e); + }, + onRestore() { + this.refresher = 'restore'; // 需要重置 + console.log("onRestore"); + }, + onAbort() { + console.log("onAbort"); + }, jumpPage(uri) { // console.log(uri); + this.$u.api.advClick({ adv_id: uri.adv_id }); common.jumpPage({ type: uri.type, id: uri.id }); } }, diff --git a/pages/mine/index.vue b/pages/mine/index.vue index e24e4e1..416000c 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -109,6 +109,10 @@ 达人申请 + + + 我的发票 + @@ -451,7 +455,7 @@ export default { width: 100rpx; } > view:not(:last-child) { - margin-right: 32rpx; + margin-right: 16rpx; } } } @@ -468,7 +472,7 @@ export default { width: 100rpx; } > view:not(:last-child) { - margin-right: 32rpx; + margin-right: 16rpx; } } .badge-box { diff --git a/pages/shop/index.vue b/pages/shop/index.vue index 28f6882..e960d99 100644 --- a/pages/shop/index.vue +++ b/pages/shop/index.vue @@ -50,7 +50,7 @@ - + @@ -211,10 +211,11 @@ }, clickImage(index) { // console.log(this.list[index]); - let item = this.list[index]; + let item = this.list[index]; this.jumpPage({ type: item.url_type, - id: item.info_id, + id: item.info_id, + adv_id: item.adv_id, }); }, // 下拉加载更多推荐商品 @@ -244,6 +245,7 @@ }, jumpPage(uri) { // console.log(uri); + this.$u.api.advClick({ adv_id: uri.adv_id }); common.jumpPage({ type: uri.type, id: uri.id }); } }, diff --git a/static/image/mine/46.png b/static/image/mine/46.png new file mode 100644 index 0000000..af89b16 Binary files /dev/null and b/static/image/mine/46.png differ