From b3aea6dd9f24484d7f72c3455f95682bd527c113 Mon Sep 17 00:00:00 2001 From: mujinxia <1764373892@qq.com> Date: Fri, 23 Feb 2024 13:21:59 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=8F=8D=E9=A6=88=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=8F=91=E7=A5=A8=E5=8F=8A=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/invoice/editset.vue | 28 +++++++++++----- pages/invoice/indexset.vue | 47 +++++++++++++++++++++++--- pages/news1/feedback.vue | 67 ++++++++++++++++++++++++++------------ 3 files changed, 109 insertions(+), 33 deletions(-) diff --git a/pages/invoice/editset.vue b/pages/invoice/editset.vue index 1bf4dab..ab9e910 100644 --- a/pages/invoice/editset.vue +++ b/pages/invoice/editset.vue @@ -133,8 +133,9 @@ export default { }, methods: { + //添加发票 // 获取当前订单信息 - toDetail(canReset = false) { + async toDetail(canReset = false) { const app = this if (app.index == -1) { uni.showToast({ @@ -160,6 +161,16 @@ export default { }) return } + console.log(app.obj) + debugger + let { + status, + data + } = await InvoiceApi.addInvoicing(app.obj); + if (status == 200) { + debugger + } + return app.isLoading = true; if (app.tabIndex == 1) { app.obj.gongsi = ''; @@ -188,7 +199,6 @@ export default { if (app.sourcePage == 4) { //我的发票记录过来编辑 url = InvoiceApi.editInvoicing(app.orderId, app.obj) } - debugger url.then(result => { if (result.status == 200) { uni.showToast({ @@ -239,7 +249,7 @@ export default { tabItem(i) { this.tabIndex = i; }, - toggleItem(i) { + toggleItem(i) { this.toggleIndex = !this.toggleIndex; this.pamres.invoiceUnit = this.toggleIndex }, @@ -256,7 +266,7 @@ export default { </script> <style lang="scss" scoped> -.invoice-btn{ +.invoice-btn { width: 100%; position: fixed; bottom: 0; @@ -265,11 +275,14 @@ export default { z-index: 8; background: #F5F5F5; } -.invoice-company{ + +.invoice-company { margin-bottom: 170rpx; } + .invoice { padding-bottom: 1rpx; + &-goods { padding: 0 20rpx 0 40rpx; overflow: hidden; @@ -475,7 +488,7 @@ export default { &-fd { height: 104rpx; background: #F55349; - border-radius: 8rpx; + border-radius: 8rpx; font-size: 32rpx; font-weight: 500; color: #FFFFFF; @@ -577,5 +590,4 @@ export default { } } -} -</style> +}</style> diff --git a/pages/invoice/indexset.vue b/pages/invoice/indexset.vue index f41a81d..6d84ed9 100644 --- a/pages/invoice/indexset.vue +++ b/pages/invoice/indexset.vue @@ -28,7 +28,7 @@ <!-- 发票抬头 --> <view v-if="tabIndex == 1"> <view class="invoice-header"> - <view class="bill-header-item" @click="onAddInvoice" v-for="(item, index) in recordList" :key="index"> + <view class="bill-header-item" @click="onAddInvoice" v-for="(item, index) in recordHeaderList" :key="index"> <view class="bill-header-left"> <view class="header-type">普通发票抬头-个人</view> <view class="bill-header"> @@ -47,6 +47,7 @@ </view> + </template> <script> @@ -57,15 +58,53 @@ export default { return { tabIndex: 0, invoicList: [], - recordList: [1, 2] + recordList: [1, 2], + recordHeaderList:[1,2] }; }, onLoad() { + this.getRecordList() }, methods: { onTabClick(index) { - this.tabIndex = index + this.tabIndex = index + if(index == 1){ + this.recordHeaderList = [] + this.getHeaderList() + }else{ + this.recordList = [] + this.getRecordList() + } + }, + //发票记录 + async getRecordList() { + uni.showLoading({ + title: "加载中" + }) + let { + status, + data + } = await InvoiceApi.invoicingLog({}); + if (status == 200) { + uni.hideLoading(); + this.recordList = data.list + } + }, + //发票抬头 + async getHeaderList() { + uni.showLoading({ + title: "加载中" + }) + let { + status, + data + } = await InvoiceApi.myInvoicing({}); + if (status == 200) { + uni.hideLoading(); + this.recordHeaderList = data.list + } }, + onEdit(item) { uni.navigateTo({ url: "/pages/invoice/editset?detail=" + JSON.stringify(item) + '&source=' + 4 @@ -90,7 +129,7 @@ export default { background: #F5F5F5; .invoice-btn { - height: 104rpx; + height: 104rpx; background: #F55349; color: #fff; font-size: 32rpx; diff --git a/pages/news1/feedback.vue b/pages/news1/feedback.vue index 4cd7501..13b7edf 100644 --- a/pages/news1/feedback.vue +++ b/pages/news1/feedback.vue @@ -22,7 +22,7 @@ <u-form-item label="反馈类型" label-width="170"> <u-radio-group v-model="form.type"> <u-radio active-color="#FF4434" v-for="(item, index) in checkboxList1" :key="index" - :name="item.name"> + :name="item.val"> {{ item.name }} </u-radio> </u-radio-group> @@ -31,7 +31,7 @@ <u-form-item label="反馈类型" label-width="170"> <u-radio-group v-model="form.shop"> <u-radio active-color="#FF4434" v-for="(item, index) in checkboxList2" :key="index" - :name="item.name"> + :name="item.val"> {{ item.name }} </u-radio> </u-radio-group> @@ -45,15 +45,16 @@ <u-form-item label="投诉内容" required label-width="150" label-position="top"> <u-input v-model="form.comment" class="textarea" placeholder="请填写投诉内容" type="textarea" /> </u-form-item> - <u-upload :fileList="finishImageList" :previewFullImage="true" @afterRead="afterRead" :maxCount="8" - width="180" height="180" upload-text="上传照片" @delete="deletePic" name="1" multiple></u-upload> + <u-upload :action="action" :header="header" :fileList="finishImageList" :previewFullImage="true" + @afterRead="afterRead" :maxCount="8" upload-text="上传照片" @delete="deletePic" name="1" + multiple></u-upload> </view> <view class="section1Item" style="margin-top:20rpx;"> <u-form-item label="您的称呼" label-width="170"> - <u-input placeholder="请输入您的称呼" v-model="form.name" /> + <u-input placeholder="请输入您的称呼" v-model="form.user_name" /> </u-form-item> <u-form-item label="手机号码" label-width="170"> - <u-input placeholder="请输入手机号" v-model="form.phone" /> + <u-input placeholder="请输入手机号" v-model="form.mobile" /> </u-form-item> </view> </u-form> @@ -71,7 +72,7 @@ <view class="feedbackItem"> <view class="feedbackContent"> <view class="fbTitle"> - <view class="fbFlag"> + <view class="fbFlag" v-if="item.type != 0"> <text v-if="item.type == 1">投诉</text> <text v-if="item.type == 2">建议</text> <text v-if="item.type == 3">表扬</text> @@ -103,7 +104,7 @@ {{ item.replay_at }} </u-form-item> <u-form-item label="反馈内容:" label-width="150" prop="feedback"> - {{ item.content }} + {{ item.reply }} </u-form-item> </u-form> </u-collapse-item> @@ -122,7 +123,7 @@ {{ item.replay_at }} </u-form-item> <u-form-item label="反馈内容:" label-width="150" prop="feedback"> - {{ item.content }} + {{ item.reply }} </u-form-item> </u-form> </u-collapse-item> @@ -130,8 +131,8 @@ </view> </view> </view> - <view class="empty" v-if="OrderType == 2"> - <u-empty text="暂无信息" mode="list"></u-empty> + <view class="empty" v-if="OrderType != 0 && total == 0"> + <u-empty text="暂无信息" mode="list"></u-empty> </view> <!-- <view class="empty" v-if="OrderType == 2"> <image class="emptyImg" :src="$picUrl + '/static/news1/feedbackempty.png'" mode="widthFix"></image> @@ -143,23 +144,26 @@ </template> <script> +import Config from '@/core/config' import * as feedback from '@/api/feedback' export default { data() { return { + action: '', + header: '', OrderType: 0, shop_id: '', + total: 1, form: { type: '', shop: '', shopText: '', comment: '', - name: '', + user_name: '', phone: '' }, - feedBackList: [], - page: 1, + feedBackList: [], checkboxList1: [{ name: '投诉', val: 1 @@ -174,10 +178,12 @@ export default { } ], checkboxList2: [{ - name: '门店' + name: '门店', + val: 1 }, { - name: '其他' + name: '其他', + val: 2 }, ], typeShow: false, @@ -187,11 +193,25 @@ export default { result: {} }; }, + onReady() { + this.action = (Config.get('apiUrl') + 'upload/image').replace("index.php?s=/", "") + this.header = { + 'Storeid': uni.getStorageSync('Store').storeInfo.store_id, + 'Access-Token': uni.getStorageSync('AccessToken'), + 'platform': "MP-WEIXIN", + } + }, onShow() { this.getShopList() }, onLoad(params) { + }, + onReachBottom() { + if (this.feedBackList.length <= this.total) { + this.pageNum++; + this.getFeedBack(this.OrderType) + } }, methods: { getShopList() { @@ -223,7 +243,7 @@ export default { }) return } - if (this.form.phone && (!/^\+?\d[\d -]{8,12}\d/.test(this.form.phone))) { + if (this.form.mobile && (!/^\+?\d[\d -]{8,12}\d/.test(this.form.mobile))) { uni.showToast({ title: '手机号格式不正确!', icon: 'none', @@ -235,7 +255,10 @@ export default { shop_id: that.shop_id, type: that.form.type, object_type: that.form.shop, - content: that.form.comment + content: that.form.comment, + user_name: that.form.user_name, + mobile: that.form.mobile, + image_id: that.image_id } return new Promise((resolve, reject) => { feedback.add(params) @@ -253,6 +276,7 @@ export default { */ onOrderTab(type) { this.OrderType = type; + this.pageNum = 1 this.feedBackList = [] if (type != 0) { this.getFeedBack(type) @@ -264,14 +288,15 @@ export default { const that = this let params = { is_my: 0, - page: that.page + page: that.pageNum } params.is_my = type == 1 ? 0 : 1 return new Promise((resolve, reject) => { feedback.list(params) .then(res => { if (res.status == 200) { - that.feedBackList = res.data.list.data + that.total = res.data.list.total + that.feedBackList =that.feedBackList.concat(res.data.list.data) } }) .catch(reject) @@ -583,6 +608,6 @@ page { align-items: center; justify-content: center; flex-direction: column; - height: calc(100vh - 102rpx); + height: calc(100vh - 102rpx); } </style> From 9f7ad9a1cf0228feba0ab9a525527bf6f6cd6fb1 Mon Sep 17 00:00:00 2001 From: mujinxia <1764373892@qq.com> Date: Fri, 23 Feb 2024 23:23:48 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E3=80=81=E5=8F=91=E7=A5=A8=E5=8A=A9=E6=89=8B=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E3=80=81=E5=8F=8D=E9=A6=88=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/help.js | 7 +- api/invoice.js | 29 ++---- pages/invoice/editset.vue | 193 ++++++++++++++++++------------------- pages/invoice/indexset.vue | 37 +++---- pages/news1/feedback.vue | 61 ++++++++---- pages/news1/text.vue | 66 ++++++------- 6 files changed, 193 insertions(+), 200 deletions(-) diff --git a/api/help.js b/api/help.js index 6a5a584..17671dc 100644 --- a/api/help.js +++ b/api/help.js @@ -8,9 +8,12 @@ const api = { joinStore: 'store/joinStore', getStoreType: 'store/getStoreType', storeSet:'store/editStore', - storeInfo:'store/getStoreInfo' + storeInfo:'store/getStoreInfo', + getAgreement: 'user/getAgreement', +} +export const getAgreement = (data) => { + return request.get(api.getAgreement,data) } - // 帮助中心列表 export const list = (param) => { return request.get(api.list, param) diff --git a/api/invoice.js b/api/invoice.js index 836aae1..abe73eb 100644 --- a/api/invoice.js +++ b/api/invoice.js @@ -9,8 +9,8 @@ const api = { invoicingDel: 'user/invoicingDel', invoicingDetail: 'user/invoicingDetail', invoicingAdd: 'user/invoicingAdd', - invoicingEdit: 'user/invoicingEdit', -} + invoicingEdit: 'user/invoicingEdit' +} export const invoicingEdit = (orderGoodsId, data) => { return request.post(api.invoicingEdit, { @@ -24,28 +24,17 @@ export const invoicingAdd = (orderGoodsId, data) => { form: data }) } -export const addInvoicing = (orderGoodsId, data) => { - return request.post(api.addInvoicing, { - orderGoodsId, - form: data - }) +export const addInvoicing = (data) => { + return request.post(api.addInvoicing,data) } export const myInvoicing = (orderGoodsId, data) => { - return request.get(api.myInvoicing, { - orderGoodsId, - form: data - }) + return request.get(api.myInvoicing,data) } -export const editInvoicing = (orderGoodsId, data) => { - return request.post(api.editInvoicing, { - form: data - }) +export const editInvoicing = (data) => { + return request.post(api.editInvoicing,data) } -export const invoicingLog = (orderGoodsId, data) => { - return request.get(api.invoicingLog, { - orderGoodsId, - form: data - }) +export const invoicingLog = (data) => { + return request.get(api.invoicingLog,data) } export function invoicingDel(param, option) { return request.get(api.invoicingDel, param, option) diff --git a/pages/invoice/editset.vue b/pages/invoice/editset.vue index ab9e910..14d972c 100644 --- a/pages/invoice/editset.vue +++ b/pages/invoice/editset.vue @@ -13,7 +13,8 @@ <view class="l">发票类型:</view> <view class="r"> <picker :value="index" :range="array" @change="bindPickerChange"> - <view class="lx">{{ index == -1 ? '请选择' : array[index] }}</view> + <view class="lx" style="color: #888;" v-if="index == null">请选择发票类型</view> + <view class="lx" v-else>{{ array[index] }}</view> </picker> </view> </view> @@ -24,17 +25,10 @@ <view class="li" :class="tabIndex == 2 ? 'li-on' : ''" @click="tabItem(2)">单位</view> </view> </view> - <view class="item" v-if="tabIndex != 2"> - <view class="l">发票抬头:</view> - <view class="r"> - <input type="text" v-model="obj.header" placeholder="请输入个人姓名" /> - </view> - </view> - <view class="item" v-if="tabIndex == 2"> + <view class="item"> <view class="l">发票抬头:</view> <view class="r"> - <input type="text" v-model="array1[index1]" placeholder="请输入单位名称" /> - <!-- <view class="tt" @click="bindPickerChange1" style="color: rgb(58, 134, 255)">更改抬头</view> --> + <input type="text" v-model="obj.header" :placeholder="tabIndex == 2 ? '请输入单位名称' : '请输入个人姓名'" /> </view> </view> <view class="item" v-if="tabIndex == 2"> @@ -77,7 +71,7 @@ </view> </view> <view class="invoice-btn"> - <view class="invoice-fd" @click="toDetail()"> + <view class="invoice-fd" @click="onSubmit()"> 提交 </view> </view> @@ -92,52 +86,66 @@ import * as InvoiceApi from '@/api/invoice' export default { data() { return { + id: '', content: "确认您的发票信息无误后再提交", show: true, toggleIndex: true, - index: -1, + index: null, array: ['普通增值税发票'], - index1: -1, - array1: [], - tabIndex: 2, + tabIndex: null, sourcePage: 0, orderDetail: '', orderId: '', obj: { header: '', - gongsi: '', duty_no: '', bank_name: '', bank_no: '', address: '', phone: '', - type: '', - source: 2 + type: 1, + source: '' } }; }, - onLoad(op) { - let app = this; - app.orderId = op.orderId - app.sourcePage = op.source == 1 ? op.source : 0 - if (op.source == 0) { - app.orderDetail = op.order ? JSON.parse(op.order) : ''; - } - if (op.source == 2 || op.source == 1) { - let detail = op.detail ? JSON.parse(op.detail) : ''; - app.index = detail.type == 1 ? 0 : 1; - app.tabIndex = detail.source - app.obj = detail + onLoad(op) { + if (op.detailObj && op.detailObj != 'null') { + let end = JSON.parse(op.detailObj) + this.index = 0 + if (end.source == 1) { + this.tabIndex = 1 + } else { + this.tabIndex = 2 + } + this.obj = end } + // let app = this; + // app.orderId = op.orderId + // app.sourcePage = op.source == 1 ? op.source : 0 + // if (op.source == 0) { + // app.orderDetail = op.order ? JSON.parse(op.order) : ''; + // } + // if (op.source == 2 || op.source == 1) { + // let detail = op.detail ? JSON.parse(op.detail) : ''; + // app.index = detail.type == 1 ? 0 : 1; + // app.tabIndex = detail.source + // app.obj = detail + // } }, methods: { - //添加发票 - // 获取当前订单信息 - async toDetail(canReset = false) { - const app = this - if (app.index == -1) { + //添加发票 + onSubmit() { + if (this.obj.id) { + this.editeInvoice() + } else { + this.addInvoice() + } + }, + async addInvoice(canReset = false) { + const app = this + if (app.index == null || !app.obj.source) { uni.showToast({ title: '请选择发票类型', icon: 'none', @@ -155,79 +163,67 @@ export default { } if (app.tabIndex == 2 && !app.obj.duty_no) { uni.showToast({ - title: '请输入抬头', + title: '请输入纳税人识别号', icon: 'none', duration: 2000 }) return } - console.log(app.obj) - debugger let { status, data } = await InvoiceApi.addInvoicing(app.obj); - if (status == 200) { - debugger - } - return - app.isLoading = true; - if (app.tabIndex == 1) { - app.obj.gongsi = ''; - app.obj.duty_no = ''; - app.obj.bank_name = ''; - app.obj.bank_no = ''; - app.obj.address = ''; - app.obj.phone = ''; - } - app.obj.type = app.index == 0 ? 1 : 2; - app.obj.source = app.tabIndex; - let url = '' - if (app.sourcePage == 0) { //开票addInvoicing editInvoicing invoicingAdd - url = InvoiceApi.invoicingAdd(app.orderId, app.obj) + if (status == 200) { + uni.showToast({ + title: '新增成功!', + icon: 'none', + duration: 2000 + }) + app.index = null + app.tabIndex =null + app.obj = app.$options.data().obj } - if (app.sourcePage == 1) { //我的开票使用某一个开票 - app.obj.invoice_id = app.obj.id; //选择 - url = InvoiceApi.invoicingAdd(app.orderId, app.obj) + }, + async editeInvoice() { + const app = this + if (app.index == null || !app.obj.source) { + uni.showToast({ + title: '请选择发票类型', + icon: 'none', + duration: 2000 + }) + return } - if (app.sourcePage == 2) { //申请记录 修改抬头 - url = InvoiceApi.invoicingEdit(app.orderId, app.obj) + if (!app.obj.header) { + uni.showToast({ + title: '请输入抬头', + icon: 'none', + duration: 2000 + }) + return } - if (app.sourcePage == 3) { //新增发票抬头 - url = InvoiceApi.addInvoicing(app.orderId, app.obj) + if (app.tabIndex == 2 && !app.obj.duty_no) { + uni.showToast({ + title: '请输入抬头', + icon: 'none', + duration: 2000 + }) + return } - if (app.sourcePage == 4) { //我的发票记录过来编辑 - url = InvoiceApi.editInvoicing(app.orderId, app.obj) + let { + status, + data + } = await InvoiceApi.editInvoicing(app.obj); + if (status == 200) { + uni.showToast({ + title: '编辑成功!', + icon: 'none', + duration: 2000 + }) + app.index = null + app.tabIndex =null + app.obj = app.$options.data().obj } - url.then(result => { - if (result.status == 200) { - uni.showToast({ - title: result.message, - icon: 'none', - duration: 2000 - }) - if (result.data.list.length.length > 0) { - uni.navigateTo({ - url: "/pages/invoice/detail?id=" + result.data.list[0].id - }) - } else { - uni.showToast({ - title: '请求成功无返回详情', - icon: 'none', - duration: 2000 - }) - } - } else { - uni.showToast({ - title: result.message, - icon: 'none', - duration: 2000 - }) - } - - }) - // 相应全局事件订阅: 刷新上级页面数据 - canReset && uni.$emit('syncRefresh', true, true) }, // 复制指定内容 @@ -247,11 +243,11 @@ export default { }, onClose() { }, tabItem(i) { - this.tabIndex = i; + this.tabIndex = i; + this.obj.source = i }, toggleItem(i) { - this.toggleIndex = !this.toggleIndex; - this.pamres.invoiceUnit = this.toggleIndex + this.toggleIndex = !this.toggleIndex; }, bindPickerChange(e) { this.index = e.detail.value; @@ -590,4 +586,5 @@ export default { } } -}</style> +} +</style> diff --git a/pages/invoice/indexset.vue b/pages/invoice/indexset.vue index 6d84ed9..ab56a34 100644 --- a/pages/invoice/indexset.vue +++ b/pages/invoice/indexset.vue @@ -15,12 +15,12 @@ <view class="bill-record" v-else> <view class="bill-item" v-for="(item, index) in recordList" :key="index"> <view class="bill-item-left"> - <view class="commpany-name">飞科网络科技有限公司</view> + <view class="commpany-name">{{item.header}}</view> <view class="bill-price"> - <text>¥</text>150 + <text>¥</text>{{item.price}} </view> </view> - <text class="bill-time">2023-12-31</text> + <text class="bill-time">{{item.created_at}}</text> </view> </view> @@ -28,18 +28,18 @@ <!-- 发票抬头 --> <view v-if="tabIndex == 1"> <view class="invoice-header"> - <view class="bill-header-item" @click="onAddInvoice" v-for="(item, index) in recordHeaderList" :key="index"> + <view class="bill-header-item" @click="onAddInvoice(item)" v-for="(item, index) in recordHeaderList" :key="index"> <view class="bill-header-left"> - <view class="header-type">普通发票抬头-个人</view> + <view class="header-type"> 普通增值税发票-{{item.source == 1?'个人':'单位'}}</view> <view class="bill-header"> - 王大幅 + {{item.header}} </view> </view> <u-icon name="edit-pen" size="30" color="#838383"></u-icon> </view> </view> <view class="invoice-btn-box"> - <view class="invoice-btn" @click="onAddInvoice"> + <view class="invoice-btn" @click="onAddInvoice(null)"> <text>+</text>添加发票抬头 </view> </view> @@ -56,10 +56,9 @@ import * as InvoiceApi from '@/api/invoice' export default { data() { return { - tabIndex: 0, - invoicList: [], - recordList: [1, 2], - recordHeaderList:[1,2] + tabIndex: 0, + recordList: [], + recordHeaderList:[] }; }, onLoad() { @@ -103,16 +102,10 @@ export default { uni.hideLoading(); this.recordHeaderList = data.list } - }, - - onEdit(item) { + }, + onAddInvoice(item) { uni.navigateTo({ - url: "/pages/invoice/editset?detail=" + JSON.stringify(item) + '&source=' + 4 - }) - }, - onAddInvoice() { - uni.navigateTo({ - url: "/pages/invoice/editset?source=" + 3 + url: "/pages/invoice/editset?detailObj=" + JSON.stringify(item) }) }, } @@ -148,12 +141,12 @@ export default { .invoice-header { background: #fff; - + padding-bottom: 164rpx; .bill-header-item { display: flex; justify-content: space-between; align-items: flex-end; - padding: 54rpx 46rpx 120rpx 64rpx; + padding: 54rpx 46rpx 64rpx 64rpx; } .header-type { diff --git a/pages/news1/feedback.vue b/pages/news1/feedback.vue index 13b7edf..63ca490 100644 --- a/pages/news1/feedback.vue +++ b/pages/news1/feedback.vue @@ -63,19 +63,26 @@ <view class="introText">1.工作人员将于1小时内与您联系解决您的问题(工作时间为周一至周日09:00~21:30)</view> <view class="introText">2.有效投诉奖励:最高奖励200元现金/代金券</view> </view> - <view class="submitBtn" @click="submit"> - 提交 + <view class="submitBtn-box"> + <view class="submitBtn" @click="submit"> + 提交 + </view> </view> + </view> <view class="section2" v-if="OrderType == 1 && feedBackList.length > 0"> <view class="feedShow" v-for="(item, index) in feedBackList" :key="index"> <view class="feedbackItem"> <view class="feedbackContent"> <view class="fbTitle"> - <view class="fbFlag" v-if="item.type != 0"> - <text v-if="item.type == 1">投诉</text> - <text v-if="item.type == 2">建议</text> - <text v-if="item.type == 3">表扬</text> + <view class="fbFlag" v-if="item.type == 1"> + <text>投诉</text> + </view> + <view class="fbFlag fbFlag2" v-if="item.type == 2"> + <text>建议</text> + </view> + <view class="fbFlag fbFlag3" v-if="item.type == 3"> + <text>表扬</text> </view> <view class="fbTitleText"> {{ item.shop_name }} @@ -87,16 +94,14 @@ </view> <u-read-more showHeight="160" textIndent="0" fontSize="26rpx" color="#9E9E9E" :toggle="true" close-text="展开"> - <rich-text v-if="index != 0" :nodes="item.content"></rich-text> - <rich-text v-else - nodes="投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容"></rich-text> + <rich-text :nodes="item.content"></rich-text> </u-read-more> <view class="timefb"> {{ item.created_at }} </view> </view> - <view class="feedbackResult"> + <view class="feedbackResult" v-if="item.status"> <u-collapse> <u-collapse-item :open="true" title="处理结果"> <u-form :model="item" ref="item" class="selfForm"> @@ -163,7 +168,7 @@ export default { phone: '' }, - feedBackList: [], + feedBackList: [], checkboxList1: [{ name: '投诉', val: 1 @@ -207,8 +212,8 @@ export default { onLoad(params) { }, - onReachBottom() { - if (this.feedBackList.length <= this.total) { + onReachBottom() { + if (this.feedBackList.length < this.total && this.OrderType!=0) { this.pageNum++; this.getFeedBack(this.OrderType) } @@ -295,8 +300,8 @@ export default { feedback.list(params) .then(res => { if (res.status == 200) { - that.total = res.data.list.total - that.feedBackList =that.feedBackList.concat(res.data.list.data) + that.total = res.data.list.total + that.feedBackList = that.feedBackList.concat(res.data.list.data) } }) .catch(reject) @@ -471,8 +476,8 @@ page { } .introContent { - margin-top: 16rpx; margin: 16rpx 30rpx 30rpx 30rpx; + padding-bottom: 160rpx; .introText { font-size: 26rpx; @@ -483,16 +488,24 @@ page { } + .submitBtn-box { + width: 100%; + position: fixed; + left: 0; + z-index: 88; + bottom: 0; + padding: 30rpx 32rpx; + background: #fff; + } + .submitBtn { height: 100rpx; background: linear-gradient(180deg, #FE7E71 0%, #FF4434 100%); border-radius: 52px 52px 52px 52px; opacity: 1; font-size: 32rpx; - font-family: PingFang SC, PingFang SC; font-weight: 500; color: #FFFFFF; - margin: 32rpx 30rpx 30rpx 30rpx; text-align: center; line-height: 100rpx; } @@ -553,7 +566,14 @@ page { color: #FF4D4D; flex-shrink: 1; } - + .fbFlag2{ + border: 1px solid #41B4EC; + color: #41B4EC; + } + .fbFlag3{ + border: 1px solid #2DC37F; + color: #2DC37F + } .fbTitleText { flex: 1; font-size: 28rpx; @@ -609,5 +629,4 @@ page { justify-content: center; flex-direction: column; height: calc(100vh - 102rpx); -} -</style> +}</style> diff --git a/pages/news1/text.vue b/pages/news1/text.vue index a3edc5e..1899500 100644 --- a/pages/news1/text.vue +++ b/pages/news1/text.vue @@ -1,60 +1,52 @@ <template> - <view> - <view class="title">{{title}}</view> - <view class="con">用户服务协议用户服务协议用户服务协议用户服务协议用户服务协议用户服务协议用户服务协议用户服务协议用户服务协议用户服务协议用户服务协议用户服务协议用户服务协议用户服务协议</view> + <view> + <view class="con">{{ content }}</view> </view> </template> <script> -import * as feedback from '@/api/feedback' +import * as help from '@/api/help' export default { data() { return { - title:'用户协议' + pageFlag: 1, + content: '' }; }, onShow() { - this.getShopList() + this.getTextData() }, onLoad(params) { - + let that = this + that.pageFlag = params.pageFlag + uni.setNavigationBarTitle({ + title: that.pageFlag == 1 ? '用户服务协议' : that.pageFlag == 2 ? '隐私政策' : '关于我们' + }) }, methods: { - getShopList() { - - const that = this - // that.shopList = [] - // return new Promise((resolve, reject) => { - // feedback.shopList() - // .then(res => { - // if (res.data.length > 0) { - // for (var i = 0; i < res.data.length; i++) { - // let obj = { - // text: res.data[i].shop_name, - // id: res.data[i].shop_id - // } - // that.shopList.push(obj) - // } - // } - // }) - // .catch(reject) - // }) + async getTextData() { + uni.showLoading({ + title: "加载中" + }) + let typeVal = this.pageFlag == 1 ? 'user' : this.pageFlag == 2 ? 'policy' : 'about' + let { + status, + data + } = await help.getAgreement({ type: typeVal }); + if (status == 200) { + uni.hideLoading(); + this.content = data.detail.content + } }, } } </script> -<style scoped lang="scss"> - .title{ - font-size: 30rpxrpx; - font-weight: bold; - text-align: center; - margin: 10rpx 20rpx; - } - .con{ +<style scoped lang="scss"> + +.con { font-size: 28rpx; - padding: 0 40rpx 40rpx; + padding: 20rpx 40rpx 40rpx; line-height: 28px; - } - +} </style> From 482f8b51762146b059476f25e81eefa370078b7b Mon Sep 17 00:00:00 2001 From: mujinxia <1764373892@qq.com> Date: Sat, 24 Feb 2024 01:17:18 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=88=91=E8=A6=81=E6=89=BE=E8=B4=A7?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5=EF=BC=8C=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E5=8F=8D=E9=A6=88=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E3=80=81=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/news1/feedback.vue | 175 +++++----- pages/news1/huoyuan.vue | 721 ++++++++++++++++++++------------------- 2 files changed, 467 insertions(+), 429 deletions(-) diff --git a/pages/news1/feedback.vue b/pages/news1/feedback.vue index 63ca490..672b864 100644 --- a/pages/news1/feedback.vue +++ b/pages/news1/feedback.vue @@ -17,7 +17,7 @@ </view> <view class="section1" v-if="OrderType == 0"> <u-form :model="form" ref="uForm"> - <view class="section1Item"> + <view class="section1Item c"> <u-form-item label="反馈类型" label-width="170"> <u-radio-group v-model="form.type"> @@ -39,15 +39,24 @@ </u-form-item> <u-form-item label="反馈类型" label-width="170" @click="typeShow = true"> <u-input v-model="form.shopText" placeholder="请选择门店" type="select" @click="typeShow = true" /> - <u-action-sheet :list="shopList" :cancel-btn="false" v-model="typeShow" - @click="actionSheetCallback"></u-action-sheet> + <!-- <u-action-sheet :list="shopList" :cancel-btn="false" v-model="typeShow" + @click="actionSheetCallback"></u-action-sheet> --> + <u-picker :range="shopList" range-key="text" @confirm="actionSheetCallback($event)" v-model="typeShow" + mode="selector"></u-picker> </u-form-item> <u-form-item label="投诉内容" required label-width="150" label-position="top"> - <u-input v-model="form.comment" class="textarea" placeholder="请填写投诉内容" type="textarea" /> + <u-input v-model="form.comment" height="228" class="realAddr" placeholder="请填写投诉内容" + type="textarea"></u-input> </u-form-item> - <u-upload :action="action" :header="header" :fileList="finishImageList" :previewFullImage="true" - @afterRead="afterRead" :maxCount="8" upload-text="上传照片" @delete="deletePic" name="1" - multiple></u-upload> + <u-upload :action="action" :header="header" @on-uploaded="transferSuccess" @on-remove="transferRemove" + width="180" height="180" :file-list="finishImageList" :custom-btn="true" max-count="6"> + <template v-slot:addBtn> + <view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> + <image :src="$picUrl + '/static/news/icon-upload.png'"></image> + <view class="1">上传照片</view> + </view> + </template> + </u-upload> </view> <view class="section1Item" style="margin-top:20rpx;"> <u-form-item label="您的称呼" label-width="170"> @@ -212,8 +221,8 @@ export default { onLoad(params) { }, - onReachBottom() { - if (this.feedBackList.length < this.total && this.OrderType!=0) { + onReachBottom() { + if (this.feedBackList.length < this.total && this.OrderType != 0) { this.pageNum++; this.getFeedBack(this.OrderType) } @@ -238,6 +247,35 @@ export default { .catch(reject) }) }, + //接受上传返回的数据 + transferSuccess(list) { + if (list.length > 0) { + const { + response + } = list[0]; + if (response.status == 200) { + uni.showToast({ + title: "上传成功" + }) + let idList = [] + list.forEach(item => { + idList.push(item.response.data.fileInfo.file_id) + }); + this.image_id = idList.join(','); + } + } + }, + transferRemove(file, fileList) { + this.image_id = this.handleRemove(file, fileList); + }, + handleRemove: function (file, fileList) { + let idList = [] + fileList.forEach(item => { + idList.push(item.response.data.fileInfo.file_id) + }); + return idList.join(',') + + }, submit() { const that = this if (that.form.comment == '') { @@ -312,70 +350,7 @@ export default { this.form.shopText = this.shopList[index].text; this.shop_id = this.shopList[index].id }, - // 新增图片 - async afterRead(event) { - - let lists = [].concat(event.file) - let fileListLen = this[`fileList${event.name}`].length - lists.map((item) => { - this[`fileList${event.name}`].push({ - ...item, - status: 'uploading', - message: '上传中' - }) - }) - for (let i = 0; i < lists.length; i++) { - const result = await this.uploadFilePromise(lists[i].url) - - if (JSON.parse(result).code == 1) { - let item = this[`fileList${event.name}`][fileListLen] - this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, { - status: 'success', - message: '', - url: result - })) - fileListLen++ - } else { - this[`fileList${event.name}`].splice(fileListLen, 1) - } - - } - - }, - //上传照片 - uploadFilePromise(url) { - return new Promise((resolve, reject) => { - let a = uni.uploadFile({ - url: this.baseUrl + '/api/common/upload', // 仅为示例,非真实的接口地址 - filePath: url, - name: 'file', - formData: { - user: 'test', - token: getToken() - }, - success: (res) => { - if (JSON.parse(res.data).code == 1) { - setTimeout(() => { - this.finishImageList.push({ url: JSON.parse(res.data).data.fullurl, path: JSON.parse(res.data).data.url }) - resolve(res.data) - }, 1000) - } else { - uni.$u.toast(JSON.parse(res.data).msg) - - resolve(res.data) - } - }, - fail: (res) => { - console.log(res, "rrr") - } - }); - }) - }, - //删除图片 - deletePic(event) { - this.finishImageList.splice(event.index, 1) - }, } } </script> @@ -388,6 +363,45 @@ page { } +.c { + padding-top: 20rpx; + overflow: hidden; + + .slot-btn { + width: 180rpx; + height: 180rpx; + background: #F6F6F6; + border-radius: 10rpx; + border: 1px solid #C0C0C0; + text-align: center; + font-size: 28rpx; + font-weight: 500; + color: #6D6D6D; + + .l { + line-height: 30rpx; + margin-top: 10rpx; + } + + image { + width: 50rpx; + height: 50rpx; + display: block; + margin: 0 auto; + margin-top: 30rpx; + } + } +} + +.realAddr { + ::v-deep .u-input { + padding: 10rpx 22upx !important; + background: #F7F8FA; + border-radius: 6rpx !important; + } + +} + /* 订单tab */ .order-tab { @@ -464,13 +478,6 @@ page { border: none; } - // .textarea { - // height: 258rpx; - // border-radius: 3px; - // border: solid 1upx #F7F8FA; - - // } - ::v-deep .u-input__textarea { padding: 26rpx; } @@ -566,14 +573,17 @@ page { color: #FF4D4D; flex-shrink: 1; } - .fbFlag2{ + + .fbFlag2 { border: 1px solid #41B4EC; color: #41B4EC; } - .fbFlag3{ + + .fbFlag3 { border: 1px solid #2DC37F; color: #2DC37F } + .fbTitleText { flex: 1; font-size: 28rpx; @@ -629,4 +639,5 @@ page { justify-content: center; flex-direction: column; height: calc(100vh - 102rpx); -}</style> +} +</style> diff --git a/pages/news1/huoyuan.vue b/pages/news1/huoyuan.vue index c000fbe..b784225 100644 --- a/pages/news1/huoyuan.vue +++ b/pages/news1/huoyuan.vue @@ -6,32 +6,32 @@ </view> </view> - <image :src="$picUrl+'/static/news1/walletBg.png'" class="bgImg" mode="widthFix"></image> + <image :src="$picUrl + '/static/news1/walletBg.png'" class="bgImg" mode="widthFix"></image> <view style="border:1px solid transparent;margin-top:-190px;position: relative;z-index: 9;"> <view class="process"> - <view class="pItem" v-for="(item,index) in list" :key="index"> + <view class="pItem" v-for="(item, index) in list" :key="index"> <image :src="item.icon" mode="widthFix" class="icon"></image> - <view class="title">{{item.title}}</view> - <view class="subTitle">{{item.subTitle}}</view> + <view class="title">{{ item.title }}</view> + <view class="subTitle">{{ item.subTitle }}</view> </view> </view> <view class="formContent"> - <u-form :model="form" ref="uForm"> + <u-form :model="form" ref="uForm" boder> <u-form-item label="商品名称" label-width="150"> <u-input placeholder="请填写您求购的商品名称" v-model="form.name" /> </u-form-item> - <u-form-item label="产品描述" label-width="150"> + <u-form-item label="产品描述:" label-width="150"> <u-input maxlength="200" placeholder="如品牌、型号、参数 、配置、规格等,可复制电商标题、链接。" v-model="form.intro" type="textarea" /> </u-form-item> <u-form-item label="求购类型" label-width="150" @click="typeShow = true"> - <u-input v-model="form.type" type="select" @click="typeShow = true" /> - <u-action-sheet :list="type" :cancel-btn="false" v-model="typeShow" - @click="actionSheetCallback"></u-action-sheet> + <u-input v-model="form.type" placeholder="请选择求购类型" type="select" @click="typeShow = true" /> + <u-picker :range="type" range-key="text" @confirm="actionSheetCallback($event)" v-model="typeShow" + mode="selector"></u-picker> </u-form-item> <u-form-item label="交货日期" label-width="150" @click="timeShow = true"> - <u-input v-model="form.date" type="select" @click="timeShow = true" /> + <u-input v-model="form.date" type="select" placeholder="请选择交货日期" @click="timeShow = true" /> <u-picker mode="time" v-model="timeShow" :params="timeParams" @confirm="timeChage"></u-picker> </u-form-item> <u-form-item label="求购数量" label-width="150"> @@ -40,9 +40,9 @@ <u-form-item label="预估单价" label-width="150"> <view class=""> <view class="qujian"> - <u-input placeholder="请输入价格区间" border v-model="form.startNum" /> + <u-input placeholder="输入价格区间" border v-model="form.startNum" /> <text style="margin:0 10upx;">-</text> - <u-input placeholder="请输入价格区间" border v-model="form.endNum" /> + <u-input placeholder="输入价格区间" border v-model="form.endNum" /> <text style="margin-left:10upx">元</text> </view> <u-checkbox-group> @@ -54,397 +54,424 @@ </view> </u-form-item> - <u-form-item label="上传照片" label-width="150"> - <view class="photo"> - <view class="file_img" v-for="(image, imageIndex) in imageList" :key="imageIndex"> - <text class="image-delete iconfont icon-shanchu" - @click="deleteImage(imageIndex)"></text> - <image :src="image.path"></image> - </view> - - <view @click="chooseImage" class="slot-btn" hover-class="slot-btn__hover" - hover-stay-time="150"> - <image src="/static/news/icon-upload.png"></image> - <view class="1">上传图片</view> - <view class="1">{{imageList.length>0?imageList.length:0}}/{{maxImageLength}}</view> - </view> - </view> + <u-form-item label="上传照片" label-width="150" class="c"> + <u-upload :action="action" :header="header" @on-uploaded="transferSuccess" + @on-remove="transferRemove" width="180" height="180" :file-list="transferList" + :custom-btn="true" max-count="6"> + <template v-slot:addBtn> + <view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> + <image :src="$picUrl + '/static/news/icon-upload.png'"></image> + <view class="1">上传照片</view> + </view> + </template> + </u-upload> </u-form-item> - <!-- <u-upload :fileList="finishImageList" :previewFullImage="true" @afterRead="afterRead" :maxCount="8" - width="180" height="180" upload-text="上传照片" @delete="deletePic" name="1" multiple></u-upload> --> <u-form-item label="收货地址" label-width="150" @click="addrshow = true"> - <u-input v-model="form.addr" type="select" @click="addrshow = true" /> + <u-input v-model="form.addr" placeholder="请选择收货地址" type="select" @click="addrshow = true" /> <u-picker mode="region" v-model="addrshow" @confirm="getAddress"></u-picker> </u-form-item> - <u-form-item label="备注" label-width="150" label-position="top"> - <u-input v-model="form.remark" class="remarkInput" placeholder="请填写您要补充的内容,如规格、包装和运输等要求" - type="textarea" /> + <u-form-item label="备注" class="self-form" label-width="150" label-position="top"> + <u-input class="realAddr" height="258" type="textarea" placeholder="请填写您要补充的内容,如规格、包装和运输等要求" + v-model="form.remark"> + </u-input> </u-form-item> + </u-form> - <button class="submitBtn" @click="sureSubmit">确认发布</button> + <view class="submitBtn-box"> + <button class="submitBtn" @click="sureSubmit">确认发布</button> + </view> </view> </view> </view> </template> <script> - // import img from "@/static/news1/walletBg.png"; - import * as help from '@/api/help' - import Config from '@/core/config' - import * as UploadApi from '@/api/upload' - export default { - data() { - let img= 'https://www.royaum.com.cn/static/news1/walletBg.png' - return { - background: { - background: 'url(' + img + ') center top no-repeat', - backgroundSize: '100%', - }, - list: [{ - icon: 'https://www.royaum.com.cn/static/news1/m1.png', - title: '发采购询价单', - subTitle: '填写所需信息一键发布询价' - }, - { - icon: 'https://www.royaum.com.cn/static/news1/m2.png', - title: '卖家实时报价', - subTitle: '60分钟获取卖家报价' - }, - { - icon: 'https://www.royaum.com.cn/static/news1/m3.png', - title: '卖家上架商品', - subTitle: '采购方案根据需要下单采购' - }, - ], - form: { - name: '', - intro: '', - type: '', - date: '', - num: '', - startNum: '', - endNum: '', - mianyi: true, - addr: '', - remark: '' - }, - typeShow: false, - timeShow: false, - addrshow: false, - type: [{ - text: '一件代发' - }], - timeParams: { - year: true, - month: true, - day: true, - hour: false, - minute: false, - second: false - }, - radioList: [{ - name: '面议' - }, - - ], - radio: '', - //照片 - imageList: [], - maxImageLength:6, - imgage_ids: [] - } - }, - methods: { - getAddress(e) { - this.form.addr = e.province.name + e.city.name + e.area.name; - this.address_id = e.province.code +// import img from "@/static/news1/walletBg.png"; +import * as help from '@/api/help' +import Config from '@/core/config' +import * as UploadApi from '@/api/upload' +export default { + data() { + let img = 'https://www.royaum.com.cn/static/news1/walletBg.png' + return { + background: { + background: 'url(' + img + ') center top no-repeat', + backgroundSize: '100%', }, - timeChage(e) { - this.form.date = e.year + '-' + e.month + '-' + e.day + list: [{ + icon: 'https://www.royaum.com.cn/static/news1/m1.png', + title: '发采购询价单', + subTitle: '填写所需信息一键发布询价' }, - sureSubmit() { - // 确认发布 0000 - const that = this; - that.uploadFile() - if (!that.form.name) { - return that.$toast('请输入商品名称') - } - if (!that.form.intro) { - return that.$toast('请输入商品信息') - } - if (!that.form.type) { - return that.$toast('请选择求购类型') - } - if (!that.form.date) { - return that.$toast('请选择交货日期') - } - if (!that.form.num) { - return that.$toast('请选择求购数量') - } - if (!that.form.startNum) { - return that.$toast('请输入最低价') - } - if (!that.form.endNum) { - return that.$toast('请输入最高价') - } - if (!that.form.mianyi) { - return that.$toast('请选择价格是否面议') - } - if (!that.form.mianyi) { - return that.$toast('请选择价格是否面议') - } - if (!that.form.remark) { - return that.$toast('请填写备注') - } - let params = { - goods_name: that.form.name, - goods_desc: that.form.intro, - type: that.form.type, - deliver_at: that.form.date, - num: that.form.num, - min_price: that.form.startNum, - max_price: that.form.endNum, - is_face: that.form.mianyi, - address_id: that.address_id, - remark: that.form.remark, - ...that.imgage_ids - } - help.addGoodsSource(params) - .then(res => { - if (res.status) { - uni.showToast({ - title: '发布成功', - icon: 'none', - duration: 2000 - }) - } else { - uni.showToast({ - title: '发布失败', - icon: 'none', - duration: 2000 - }) - } - }) - .finally() + { + icon: 'https://www.royaum.com.cn/static/news1/m2.png', + title: '卖家实时报价', + subTitle: '60分钟获取卖家报价' }, - actionSheetCallback(index) { - this.form.type = this.type[index].text; + { + icon: 'https://www.royaum.com.cn/static/news1/m3.png', + title: '卖家上架商品', + subTitle: '采购方案根据需要下单采购' }, - deleteImage(imageIndex) { - this.imageList.splice(imageIndex, 1) + ], + form: { + name: '', + intro: '', + type: '', + date: '', + num: '', + startNum: '', + endNum: '', + mianyi: true, + addr: '', + remark: '' }, - // 选择图片 - chooseImage() { - const app = this - const oldImageList = app.imageList - // 选择图片 - uni.chooseImage({ - count: app.maxImageLength - oldImageList.length, - sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 - sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 - success({ - tempFiles - }) { - app.imageList = oldImageList.concat(tempFiles) - } - }); + typeShow: false, + timeShow: false, + addrshow: false, + type: [{ + text: '一件代发' + }], + timeParams: { + year: true, + month: true, + day: true, + hour: false, + minute: false, + second: false + }, + radioList: [{ + name: '面议' }, - // 上传图片 - uploadFile() { - const app = this + ], + radio: '', + //照片 + imageList: [], + maxImageLength: 6, + imgage_ids: [], + action: '', + header: '', + transferList: [] + } + }, + onReady() { + this.action = (Config.get('apiUrl') + 'upload/image').replace("index.php?s=/", "") + this.header = { + 'Storeid': uni.getStorageSync('Store').storeInfo.store_id, + 'Access-Token': uni.getStorageSync('AccessToken'), + 'platform': "MP-WEIXIN", + } + }, + methods: { + //接受上传返回的数据 + transferSuccess(list) { + console.log(list) + if (list.length > 0) { const { - imageList - } = app - // 批量上传 - return new Promise((resolve, reject) => { - if (imageList.length > 0) { - UploadApi.image(imageList) - .then(fileIds => { - app.imgage_ids = fileIds; - resolve(fileIds) - }) - .catch(reject) + response + } = list[0]; + if (response.status == 200) { + uni.showToast({ + title: "上传成功" + }) + let idList = [] + list.forEach(item => { + idList.push(item.response.data.fileInfo.file_id) + }); + this.imgage_ids = idList.join(','); + } + } + }, + transferRemove(file, fileList) { + this.imgage_ids = this.handleRemove(file, fileList); + }, + handleRemove: function (file, fileList) { + let idList = [] + fileList.forEach(item => { + idList.push(item.response.data.fileInfo.file_id) + }); + return idList.join(',') + + }, + getAddress(e) { + this.form.addr = e.province.name + e.city.name + e.area.name; + this.address_id = e.province.code + }, + timeChage(e) { + this.form.date = e.year + '-' + e.month + '-' + e.day + }, + sureSubmit() { + // 确认发布 + const that = this; + if (!that.form.name) { + return that.$toast('请输入商品名称') + } + if (!that.form.intro) { + return that.$toast('请输入商品信息') + } + if (!that.form.type) { + return that.$toast('请选择求购类型') + } + if (!that.form.date) { + return that.$toast('请选择交货日期') + } + if (!that.form.num) { + return that.$toast('请选择求购数量') + } + if (!that.form.startNum) { + return that.$toast('请输入最低价') + } + if (!that.form.endNum) { + return that.$toast('请输入最高价') + } + if (!that.form.mianyi) { + return that.$toast('请选择价格是否面议') + } + if (!that.form.mianyi) { + return that.$toast('请选择价格是否面议') + } + if (!that.form.remark) { + return that.$toast('请填写备注') + } + let params = { + goods_name: that.form.name, + goods_desc: that.form.intro, + type: that.form.type, + deliver_at: that.form.date, + num: that.form.num, + min_price: that.form.startNum, + max_price: that.form.endNum, + is_face: that.form.mianyi, + address_id: that.address_id, + remark: that.form.remark, + imgage_ids: that.imgage_ids + } + help.addGoodsSource(params) + .then(res => { + if (res.status) { + uni.showToast({ + title: '发布成功', + icon: 'none', + duration: 2000 + }) + that.transferList = [] + that.imgage_ids = [] + that.form = that.$options.data().form } else { - resolve() + uni.showToast({ + title: '发布失败', + icon: 'none', + duration: 2000 + }) } }) - }, + .finally() + }, + actionSheetCallback(index) { + this.form.type = this.type[index].text; } } +} </script> <style lang="scss" scoped> - page { - min-height: 100%; - padding-bottom: 100upx; - } +page { + min-height: 100%; + padding-bottom: 100upx; +} - .huoyuan { - .process { - height: 266upx; - background: #FFFFFF; - border-radius: 14upx; - opacity: 1; - display: flex; - align-items: center; - justify-content: space-between; - margin: 0 30upx; - // padding:0 28upx; - position: relative; - - .pItem { - flex: 1; - height: 100%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - - image { - width: 56upx; - height: auto; - } +.c { + padding-top: 20rpx; + overflow: hidden; - .title { - font-size: 24upx; - font-family: PingFang SC, PingFang SC; - font-weight: 600; - color: #2D2D2D; - margin: 16upx 0; - } + .slot-btn { + width: 180rpx; + height: 180rpx; + background: #F6F6F6; + border-radius: 10rpx; + border: 1px solid #C0C0C0; + text-align: center; + font-size: 28rpx; + font-weight: 500; + color: #6D6D6D; - .subTitle { - font-size: 24upx; - font-family: PingFang SC, PingFang SC; - font-weight: 400; - color: #8A8A8A; - width: 75%; - text-align: center; + .l { + line-height: 30rpx; + } - } - } + image { + width: 50rpx; + height: 50rpx; + display: block; + margin: 0 auto; + margin-top: 30rpx; } + } +} + +.self-form { + ::v-deep .u-form-item { + border: none !important; + ; + } +} + +.realAddr { + ::v-deep .u-input { + padding: 10rpx 22upx !important; + background: #F7F8FA; + } - .formContent { - margin: 0 30upx; - background-color: #fff; - border-radius: 14upx; - margin-top: 20upx; - padding: 0 38upx; - padding-bottom: 64upx; +} - ::v-deep .u-form-item--left { - align-items: flex-start; +.huoyuan { + .process { + height: 266upx; + background: #FFFFFF; + border-radius: 14upx; + opacity: 1; + display: flex; + align-items: center; + justify-content: space-between; + margin: 0 30upx; + // padding:0 28upx; + position: relative; + + .pItem { + flex: 1; + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + image { + width: 56upx; + height: auto; } - ::v-deep .u-form-item--left__content__label { + .title { + font-size: 24upx; + font-family: PingFang SC, PingFang SC; + font-weight: 600; color: #2D2D2D; - font-size: 28upx; + margin: 16upx 0; } - .qujian { - width: 100%; - display: flex; - align-items: center; + .subTitle { + font-size: 24upx; + font-family: PingFang SC, PingFang SC; + font-weight: 400; + color: #8A8A8A; + width: 75%; + text-align: center; + } } } - .remarkInput { - width: 100%; - height: 246upx; - background: #F7F8FA; - border-radius: 3px 3px 3px 3px; - opacity: 1; - padding: 20upx !important; + .formContent { + margin: 0 30upx; + background-color: #fff; + border-radius: 14upx; + margin-top: 20upx; + padding: 0 38upx; + padding-bottom: 135upx; + + ::v-deep .u-form-item--left { + align-items: flex-start; + } + + ::v-deep .u-form-item--left__content__label { + color: #2D2D2D; + font-size: 28upx; + } + + .qujian { + width: 100%; + display: flex; + align-items: center; + margin-bottom: 30rpx; + } } +} - .submitBtn { - height: 88upx; - margin: 64upx 0; - margin-bottom: 0; - line-height: 88upx; - // background: #FFAAA4; - background: #FE483B; - border-radius: 36px 36px 36px 36px; - opacity: 1; - font-size: 28upx; +.remarkInput { + // width: 100%; + // height: 246upx; + background: green; + border-radius: 3px; + padding: 20upx !important; +} + +.submitBtn-box { + position: fixed; + width: 100%; + left: 0; + bottom: 0; + padding: 30rpx 34rpx; + z-index: 88; + background: #fff; +} + +.submitBtn { + height: 88upx; + line-height: 88upx; + // background: #FFAAA4; + background: #FE483B; + border-radius: 36px; + font-size: 28upx; + font-family: PingFang SC, PingFang SC; + font-weight: 500; + color: #FFFFFF; + text-align: center; +} + +.navBarContent { + height: 88upx; + line-height: 88upx; + text-align: center; + position: relative; + + text { + font-size: 32upx; font-family: PingFang SC, PingFang SC; font-weight: 500; color: #FFFFFF; - text-align: center; } - .navBarContent { - height: 88upx; - line-height: 88upx; - text-align: center; - position: relative; +} - text { - font-size: 32upx; - font-family: PingFang SC, PingFang SC; - font-weight: 500; - color: #FFFFFF; - } +.bgImg { + width: 100%; +} - } +.file_img { + overflow: hidden; + position: relative; - .bgImg { - width: 100%; + image { + width: 80px; + height: 80px; + margin-right: 10rpx; } - .photo { + .image-delete { + position: absolute; + top: -10rpx; + right: -10rpx; + height: 42rpx; + width: 42rpx; + background: rgba(0, 0, 0, 0.64); + border-radius: 50%; + color: #fff; + font-weight: bolder; + font-size: 22rpx; + z-index: 10; display: flex; - justify-content: flex-start; - padding: 20rpx 0; - overflow: hidden; - - .slot-btn { - width: 80px; - height: 80px; - background: #FFFFFF; - border-radius: 10rpx; - border: 1px solid #C0C0C0; - text-align: center; - font-size: 24rpx; - font-weight: 500; - color: #D1D1D1; - - image { - width: 50rpx; - height: 50rpx; - margin-top: 20rpx; - } - } - } - - .file_img { - overflow: hidden; - position: relative; - - image { - width: 80px; - height: 80px; - margin-right: 10rpx; - } - - .image-delete { - position: absolute; - top: -10rpx; - right: -10rpx; - height: 42rpx; - width: 42rpx; - background: rgba(0, 0, 0, 0.64); - border-radius: 50%; - color: #fff; - font-weight: bolder; - font-size: 22rpx; - z-index: 10; - display: flex; - justify-content: center; - align-items: center; - } + justify-content: center; + align-items: center; } +} </style> From b7814ac0cbdadbf923c9743d8613e638c9bb5f9d Mon Sep 17 00:00:00 2001 From: mujinxia <1764373892@qq.com> Date: Sat, 24 Feb 2024 10:47:47 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= =?UTF-8?q?=EF=BC=8C=E4=BB=A3=E7=A0=81=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/news1/feedback.vue | 24 ++++++++++++----------- pages/news1/setting.vue | 42 ++++++++++++++++++++++------------------ 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/pages/news1/feedback.vue b/pages/news1/feedback.vue index 672b864..36cce0e 100644 --- a/pages/news1/feedback.vue +++ b/pages/news1/feedback.vue @@ -41,8 +41,8 @@ <u-input v-model="form.shopText" placeholder="请选择门店" type="select" @click="typeShow = true" /> <!-- <u-action-sheet :list="shopList" :cancel-btn="false" v-model="typeShow" @click="actionSheetCallback"></u-action-sheet> --> - <u-picker :range="shopList" range-key="text" @confirm="actionSheetCallback($event)" v-model="typeShow" - mode="selector"></u-picker> + <u-picker :range="shopList" range-key="text" @confirm="actionSheetCallback($event)" + v-model="typeShow" mode="selector"></u-picker> </u-form-item> <u-form-item label="投诉内容" required label-width="150" label-position="top"> <u-input v-model="form.comment" height="228" class="realAddr" placeholder="请填写投诉内容" @@ -79,7 +79,7 @@ </view> </view> - <view class="section2" v-if="OrderType == 1 && feedBackList.length > 0"> + <view class="section2" v-if="OrderType != 0 && feedBackList.length > 0"> <view class="feedShow" v-for="(item, index) in feedBackList" :key="index"> <view class="feedbackItem"> <view class="feedbackContent"> @@ -105,14 +105,17 @@ close-text="展开"> <rich-text :nodes="item.content"></rich-text> </u-read-more> + <view class="timefb" v-if="OrderType == 1"> + <text>反馈人:</text> {{ item.user_name }} + </view> <view class="timefb"> - {{ item.created_at }} + <text>反馈时间:</text> {{ item.created_at }} </view> </view> <view class="feedbackResult" v-if="item.status"> <u-collapse> - <u-collapse-item :open="true" title="处理结果"> + <u-collapse-item :open="false" title="处理结果"> <u-form :model="item" ref="item" class="selfForm"> <u-form-item label="处理时间:" label-width="150" prop="time"> {{ item.replay_at }} @@ -127,7 +130,7 @@ </view> </view> </view> - <view class="section2" v-if="OrderType == 2 && feedBackList.length > 0"> + <!-- <view class="section2" v-if="OrderType == 2 && feedBackList.length > 0"> <view class="feedShow" style="padding: 0;" v-for="(item, index) in feedBackList" :key="index"> <view class="feedbackResult"> <u-collapse> @@ -144,7 +147,7 @@ </u-collapse> </view> </view> - </view> + </view> --> <view class="empty" v-if="OrderType != 0 && total == 0"> <u-empty text="暂无信息" mode="list"></u-empty> </view> @@ -563,8 +566,7 @@ page { // width: calc(100% - 100rpx); .fbFlag { background: #FFFFFF; - border-radius: 3px; - opacity: 1; + border-radius: 3px; padding: 5rpx; border: 1px solid #FF4D4D; font-size: 26rpx; @@ -572,6 +574,7 @@ page { font-weight: 500; color: #FF4D4D; flex-shrink: 1; + margin-right: 20rpx; } .fbFlag2 { @@ -591,8 +594,7 @@ page { overflow: hidden; text-overflow: ellipsis; color: #000; - font-weight: bold; - margin-left: 20rpx; + font-weight: bold; } } diff --git a/pages/news1/setting.vue b/pages/news1/setting.vue index e89ccbc..103a765 100644 --- a/pages/news1/setting.vue +++ b/pages/news1/setting.vue @@ -30,12 +30,7 @@ <view class="name-text"> 手机号 </view> - <input type="number" v-model="info.mobile" placeholder="请输入手机号"> - - <!-- <view> - <text>{{ info.mobile }}</text> - <u-icon style="margin-left: 5rpx; color: #8A8A8A" name="arrow-right"></u-icon> - </view> --> + <text>{{ info.mobile }}</text> </view> </view> <view class="box"> @@ -45,21 +40,21 @@ </view> <u-icon style="margin-left: 5rpx; color: #8A8A8A" name="arrow-right"></u-icon> </view> - <view class="box-avter conten-height"> + <view class="box-avter conten-height" @click="toTextPage(1)"> <view class="name-text"> - 清除缓存 + 用户服务协议 </view> <u-icon style="margin-left: 5rpx; color: #8A8A8A" name="arrow-right"></u-icon> </view> - <view class="box-avter conten-height"> + <view class="box-avter conten-height" @click="toTextPage(2)"> <view class="name-text"> - 隐私 + 隐私政策 </view> <u-icon style="margin-left: 5rpx; color: #8A8A8A" name="arrow-right"></u-icon> </view> - <view class="box-avter conten-height"> + <view class="box-avter conten-height" @click="toTextPage(3)"> <view class="name-text"> - 关于 + 关于我们 </view> <u-icon style="margin-left: 5rpx; color: #8A8A8A" name="arrow-right"></u-icon> </view> @@ -74,7 +69,7 @@ <view class="bottomBtn"> <button class="submitBtn" @click="sureSubmit">确认修改</button> </view> - + </view> </template> @@ -178,6 +173,8 @@ export default { if (o.confirm) { uni.removeStorage('token'); uni.removeStorage('userInfo'); + uni.clearStorageSync() + uni.clearStorage() uni.reLaunch({ url: '/pages/login/index' }) @@ -185,9 +182,14 @@ export default { } }); }, + toTextPage(n) { + uni.navigateTo({ + url: "/pages/news1/text?pageFlag=" + n + }) + }, bindPickerInvoice() { uni.navigateTo({ - url: "/pages/invoice/index" + url: "/pages/invoice/indexset" }) }, bindPickerChange(e) { @@ -219,7 +221,7 @@ page { height: 28rpx; } -.box-avter { +.box-avter { width: 100%; display: flex; justify-content: space-between; @@ -254,7 +256,8 @@ page { height: 114rpx; border-radius: 50%; } -.bottomBtn{ + +.bottomBtn { width: 100%; position: fixed; bottom: 0; @@ -263,12 +266,13 @@ page { z-index: 88; background: #fff; } -.submitBtn { - height: 88upx; + +.submitBtn { + height: 88upx; line-height: 88upx; background: #FFAAA4; background: #FE483B; - border-radius: 36px; + border-radius: 36px; font-size: 28upx; font-family: PingFang SC, PingFang SC; font-weight: 500; From 4a6af73b4f8f9239e7822c76d15ce31c44ebef37 Mon Sep 17 00:00:00 2001 From: mujinxia <1764373892@qq.com> Date: Sat, 24 Feb 2024 13:21:37 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=8F=8D=E9=A6=88=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=B1=95=E7=A4=BA=EF=BC=8C=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E5=B8=AE=E5=8A=A9=E4=B8=AD=E5=BF=83=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/news1/feedback.vue | 25 +++++++++++++++++++++---- pages/news1/help.vue | 14 +++++++------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/pages/news1/feedback.vue b/pages/news1/feedback.vue index 36cce0e..df50cca 100644 --- a/pages/news1/feedback.vue +++ b/pages/news1/feedback.vue @@ -104,6 +104,11 @@ <u-read-more showHeight="160" textIndent="0" fontSize="26rpx" color="#9E9E9E" :toggle="true" close-text="展开"> <rich-text :nodes="item.content"></rich-text> + <view v-if="item.file_path"> + <u-upload width="180" height="180" max-count="1" :file-list="item.file_paths" :deletable="false"> + </u-upload> + </view> + </u-read-more> <view class="timefb" v-if="OrderType == 1"> <text>反馈人:</text> {{ item.user_name }} @@ -165,7 +170,7 @@ import Config from '@/core/config' import * as feedback from '@/api/feedback' export default { data() { - return { + return { action: '', header: '', OrderType: 0, @@ -342,7 +347,19 @@ export default { .then(res => { if (res.status == 200) { that.total = res.data.list.total - that.feedBackList = that.feedBackList.concat(res.data.list.data) + let end = res.data.list.data + end.map(itme=>{ + if(itme.file_path){ + itme.file_paths = [] + let img_arr = itme.file_path.split(',') + img_arr.map(src=>{ + itme.file_paths.push({ + url:src + }) + }) + } + }) + that.feedBackList = that.feedBackList.concat(end) } }) .catch(reject) @@ -566,7 +583,7 @@ page { // width: calc(100% - 100rpx); .fbFlag { background: #FFFFFF; - border-radius: 3px; + border-radius: 3px; padding: 5rpx; border: 1px solid #FF4D4D; font-size: 26rpx; @@ -594,7 +611,7 @@ page { overflow: hidden; text-overflow: ellipsis; color: #000; - font-weight: bold; + font-weight: bold; } } diff --git a/pages/news1/help.vue b/pages/news1/help.vue index dcf07b9..363431d 100644 --- a/pages/news1/help.vue +++ b/pages/news1/help.vue @@ -90,11 +90,13 @@ border-radius: 20upx; overflow: hidden; padding: 20upx; + padding-bottom: 160rpx; .helpTitle { font-size: 32upx; color: #000000; padding: 20upx 0; + font-weight: bold; // border-bottom: 3upx solid #dfdbdb; } @@ -184,18 +186,15 @@ bottom: 0; width: 100%; background-color: #fff; - + padding: 30rpx; .btn { - height: 100upx; - margin: 10upx 30upx; + height: 100upx; background: #FE6048; border-radius: 28px 28px 28px 28px; opacity: 1; display: flex; - align-items: center; - - justify-content: center; - + align-items: center; + justify-content: center; image { width: 54upx; height: auto; @@ -213,6 +212,7 @@ image { width: 54upx; height: auto; + margin-right: 100rpx; } text-align: center; display: flex; From d037de83ea203c306fd805f385c77ecb5451a92c Mon Sep 17 00:00:00 2001 From: mujinxia <1764373892@qq.com> Date: Sat, 24 Feb 2024 14:02:11 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=8C=89=E9=92=AE=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/invoice/editset.vue | 2 +- pages/invoice/indexset.vue | 9 ++++++++- pages/news1/setting.vue | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pages/invoice/editset.vue b/pages/invoice/editset.vue index 14d972c..5c20e38 100644 --- a/pages/invoice/editset.vue +++ b/pages/invoice/editset.vue @@ -269,7 +269,7 @@ export default { left: 0; padding: 30rpx 44rpx; z-index: 8; - background: #F5F5F5; + background: #fafafa; } .invoice-company { diff --git a/pages/invoice/indexset.vue b/pages/invoice/indexset.vue index ab56a34..3f33fbc 100644 --- a/pages/invoice/indexset.vue +++ b/pages/invoice/indexset.vue @@ -34,6 +34,9 @@ <view class="bill-header"> {{item.header}} </view> + <view class="bill-header" style="margin-top:18rpx" v-if="item.source==2"> + 税号:{{item.duty_no}} + </view> </view> <u-icon name="edit-pen" size="30" color="#838383"></u-icon> </view> @@ -112,6 +115,9 @@ export default { } </script> <style lang="scss" scoped> +page{ + background: red; +} .invoice-btn-box { width: 100%; position: fixed; @@ -119,7 +125,7 @@ export default { left: 0; padding: 30rpx 44rpx; z-index: 8; - background: #F5F5F5; + background: #fafafa; .invoice-btn { height: 104rpx; @@ -147,6 +153,7 @@ export default { justify-content: space-between; align-items: flex-end; padding: 54rpx 46rpx 64rpx 64rpx; + font-size: 32rpx; } .header-type { diff --git a/pages/news1/setting.vue b/pages/news1/setting.vue index 103a765..de46b3d 100644 --- a/pages/news1/setting.vue +++ b/pages/news1/setting.vue @@ -264,7 +264,7 @@ page { left: 0; height: 140upx; z-index: 88; - background: #fff; + background: #fafafa; } .submitBtn { From 07545d28af9b9866a6b64d6d0fb22d1da6ec76c5 Mon Sep 17 00:00:00 2001 From: mujinxia <1764373892@qq.com> Date: Sat, 24 Feb 2024 14:46:07 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E5=8A=A9=E6=89=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/invoice.js | 7 ++- pages/invoice/indexset.vue | 104 +++++++++++++++++++++++++------------ pages/news1/feedback.vue | 2 +- 3 files changed, 78 insertions(+), 35 deletions(-) diff --git a/api/invoice.js b/api/invoice.js index abe73eb..1c5d628 100644 --- a/api/invoice.js +++ b/api/invoice.js @@ -9,9 +9,12 @@ const api = { invoicingDel: 'user/invoicingDel', invoicingDetail: 'user/invoicingDetail', invoicingAdd: 'user/invoicingAdd', - invoicingEdit: 'user/invoicingEdit' + invoicingEdit: 'user/invoicingEdit', + invoicingDelNew: 'user/delInvoicing' } - +export const invoicingDelNew = (data) => { + return request.get(api.invoicingDelNew,data) +} export const invoicingEdit = (orderGoodsId, data) => { return request.post(api.invoicingEdit, { orderGoodsId, diff --git a/pages/invoice/indexset.vue b/pages/invoice/indexset.vue index 3f33fbc..a1e7c0d 100644 --- a/pages/invoice/indexset.vue +++ b/pages/invoice/indexset.vue @@ -15,31 +15,37 @@ <view class="bill-record" v-else> <view class="bill-item" v-for="(item, index) in recordList" :key="index"> <view class="bill-item-left"> - <view class="commpany-name">{{item.header}}</view> + <view class="commpany-name">{{ item.header }}</view> <view class="bill-price"> - <text>¥</text>{{item.price}} + <text>¥</text>{{ item.price }} </view> </view> - <text class="bill-time">{{item.created_at}}</text> + <text class="bill-time">{{ item.created_at }}</text> </view> </view> </view> <!-- 发票抬头 --> <view v-if="tabIndex == 1"> - <view class="invoice-header"> - <view class="bill-header-item" @click="onAddInvoice(item)" v-for="(item, index) in recordHeaderList" :key="index"> - <view class="bill-header-left"> - <view class="header-type"> 普通增值税发票-{{item.source == 1?'个人':'单位'}}</view> - <view class="bill-header"> - {{item.header}} - </view> - <view class="bill-header" style="margin-top:18rpx" v-if="item.source==2"> - 税号:{{item.duty_no}} + <view class="empty" v-if="recordHeaderList.length == 0"> + <u-empty text="暂无信息" mode="list"></u-empty> + </view> + <view v-else class="invoice-header"> + <u-swipe-action :show="item.show" :options="options" @click="onActionClick(index)" + v-for="(item, index) in recordHeaderList" :key="index" @open="onActionOpen(index)"> + <view class="bill-header-item" @click="onAddInvoice(item)"> + <view class="bill-header-left"> + <view class="header-type"> 普通增值税发票-{{ item.source == 1 ? '个人' : '单位' }}</view> + <view class="bill-header"> + {{ item.header }} + </view> + <view class="bill-header" style="margin-top:18rpx" v-if="item.source == 2"> + 税号:{{ item.duty_no }} + </view> </view> + <u-icon name="edit-pen" size="30" color="#838383"></u-icon> </view> - <u-icon name="edit-pen" size="30" color="#838383"></u-icon> - </view> + </u-swipe-action> </view> <view class="invoice-btn-box"> <view class="invoice-btn" @click="onAddInvoice(null)"> @@ -50,7 +56,6 @@ </view> - </template> <script> @@ -59,9 +64,17 @@ import * as InvoiceApi from '@/api/invoice' export default { data() { return { - tabIndex: 0, + tabIndex: 0, recordList: [], - recordHeaderList:[] + recordHeaderList: [], + options: [ + { + text: '删除', + style: { + backgroundColor: '#dd524d' + } + } + ] }; }, onLoad() { @@ -69,12 +82,12 @@ export default { }, methods: { onTabClick(index) { - this.tabIndex = index - if(index == 1){ + this.tabIndex = index + if (index == 1) { this.recordHeaderList = [] this.getHeaderList() - }else{ - this.recordList = [] + } else { + this.recordList = [] this.getRecordList() } }, @@ -82,30 +95,55 @@ export default { async getRecordList() { uni.showLoading({ title: "加载中" - }) + }) let { - status, + status, data } = await InvoiceApi.invoicingLog({}); if (status == 200) { - uni.hideLoading(); - this.recordList = data.list + uni.hideLoading(); + this.recordList = data.list } }, //发票抬头 async getHeaderList() { uni.showLoading({ title: "加载中" - }) + }) let { - status, + status, data } = await InvoiceApi.myInvoicing({}); if (status == 200) { - uni.hideLoading(); - this.recordHeaderList = data.list + uni.hideLoading(); + this.recordHeaderList = data.list + this.recordHeaderList.map(item => { + item.show = false + }) } - }, + }, + //删除 + async onActionClick(index) { + let that = this + let { + status, + data + } = await InvoiceApi.invoicingDelNew({ id: that.recordHeaderList[index].id}); + if (status == 200) { + that.getHeaderList() + uni.showToast({ + title: '删除成功!', + icon: 'none', + duration: 2000 + }) + } + }, + onActionOpen(index) { + this.recordHeaderList[index].show = true; + this.recordHeaderList.map((val, idx) => { + if (index != idx) this.recordHeaderList[idx].show = false; + }) + }, onAddInvoice(item) { uni.navigateTo({ url: "/pages/invoice/editset?detailObj=" + JSON.stringify(item) @@ -115,9 +153,10 @@ export default { } </script> <style lang="scss" scoped> -page{ +page { background: red; } + .invoice-btn-box { width: 100%; position: fixed; @@ -148,11 +187,12 @@ page{ .invoice-header { background: #fff; padding-bottom: 164rpx; + .bill-header-item { display: flex; justify-content: space-between; align-items: flex-end; - padding: 54rpx 46rpx 64rpx 64rpx; + padding: 40rpx 46rpx 40rpx 64rpx; font-size: 32rpx; } diff --git a/pages/news1/feedback.vue b/pages/news1/feedback.vue index df50cca..b25540f 100644 --- a/pages/news1/feedback.vue +++ b/pages/news1/feedback.vue @@ -522,7 +522,7 @@ page { z-index: 88; bottom: 0; padding: 30rpx 32rpx; - background: #fff; + background: #fafafa; } .submitBtn {