|
@@ -631,7 +631,7 @@
|
|
|
invoiceDetail.invoiceImg
|
|
|
"
|
|
|
>
|
|
|
- <view slot="title">发票预览:</view>
|
|
|
+ <!-- <view slot="title">发票预览:</view>
|
|
|
<view>
|
|
|
<image
|
|
|
class="preview"
|
|
@@ -643,7 +643,12 @@
|
|
|
@click="download(invoiceDetail)"
|
|
|
>下载电子发票</view
|
|
|
>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
+ <view
|
|
|
+ class="download-btn"
|
|
|
+ @click="download(invoiceDetail)"
|
|
|
+ >下载电子发票</view
|
|
|
+ >
|
|
|
</u-cell-item>
|
|
|
|
|
|
<u-cell-item
|
|
@@ -728,6 +733,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapGetters } from "vuex";
|
|
|
+import { download } from "../../common/util";
|
|
|
export default {
|
|
|
components: {},
|
|
|
data() {
|
|
@@ -773,10 +779,6 @@ export default {
|
|
|
validator: (rule, value, callback) => {
|
|
|
// 上面有说,返回true表示校验通过,返回false表示不通过
|
|
|
// this.$u.test.mobile()就是返回true或者false的
|
|
|
- console.log(
|
|
|
- this.$u.test.mobile(value),
|
|
|
- "this.$u.test.mobile(value)"
|
|
|
- );
|
|
|
return this.$u.test.mobile(value);
|
|
|
},
|
|
|
message: "手机号码格式不正确",
|
|
@@ -998,7 +1000,6 @@ export default {
|
|
|
this.invoiceDetail = item;
|
|
|
},
|
|
|
toFixed(number) {
|
|
|
- console.log(number.toFixed(2));
|
|
|
return number.toFixed(2);
|
|
|
},
|
|
|
/**
|
|
@@ -1027,8 +1028,6 @@ export default {
|
|
|
*/
|
|
|
formSubmit() {
|
|
|
this.$refs.uForm.validate((valid) => {
|
|
|
- console.log(valid, "valid");
|
|
|
- console.log(this.form, "this.form");
|
|
|
if (valid) {
|
|
|
if (this.invoicePirce > 10000) {
|
|
|
uni.showModal({
|
|
@@ -1091,7 +1090,6 @@ export default {
|
|
|
* 发票类型修改
|
|
|
*/
|
|
|
formTypeChange(e) {
|
|
|
- console.log(e);
|
|
|
if (e == "2") {
|
|
|
this.$set(this.form, "subject", "2");
|
|
|
} else {
|
|
@@ -1102,9 +1100,7 @@ export default {
|
|
|
* tabs 切换
|
|
|
*/
|
|
|
change(e) {
|
|
|
- console.log(e);
|
|
|
this.current = e;
|
|
|
-
|
|
|
if (this.current == 1) {
|
|
|
this.orderInvoiceList();
|
|
|
} else {
|
|
@@ -1162,7 +1158,6 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.orderGoodsIds.onFieldChange();
|
|
|
});
|
|
|
- console.log(this.$refs.orderGoodsIds);
|
|
|
},
|
|
|
|
|
|
deleteOrder(index) {
|
|
@@ -1189,15 +1184,7 @@ export default {
|
|
|
urls: [this.$method.splitImgHost(item.invoiceImg, true, 1000)],
|
|
|
longPressActions: {
|
|
|
itemList: ["发送给朋友", "保存图片", "收藏"],
|
|
|
- success: function (data) {
|
|
|
- console.log(
|
|
|
- "选中了第" +
|
|
|
- (data.tapIndex + 1) +
|
|
|
- "个按钮,第" +
|
|
|
- (data.index + 1) +
|
|
|
- "张图片"
|
|
|
- );
|
|
|
- },
|
|
|
+ success: function (data) {},
|
|
|
fail: function (err) {
|
|
|
console.log(err.errMsg);
|
|
|
},
|
|
@@ -1206,70 +1193,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
download(item) {
|
|
|
- // #ifdef H5
|
|
|
- window.location.href = this.$method.splitImgHost(
|
|
|
- item.certificatePath,
|
|
|
- true,
|
|
|
- 1000
|
|
|
- );
|
|
|
- // #endif
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
- //获取相册授权
|
|
|
- uni.getSetting({
|
|
|
- success: (res) => {
|
|
|
- console.log("🚀 ~ file: index.vue:1221 ~ download ~ res:", res);
|
|
|
- if (!res.authSetting["scope.writePhotosAlbum"]) {
|
|
|
- uni.authorize({
|
|
|
- scope: "scope.writePhotosAlbum",
|
|
|
- success() {
|
|
|
- //这里是用户同意授权后的回调
|
|
|
- this.saveImgToLocal(item);
|
|
|
- },
|
|
|
- fail() {
|
|
|
- //这里是用户拒绝授权后的回调
|
|
|
- },
|
|
|
- });
|
|
|
- } else {
|
|
|
- //用户已经授权过了
|
|
|
- this.saveImgToLocal(item);
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
- // #endif
|
|
|
- },
|
|
|
-
|
|
|
- saveImgToLocal(item) {
|
|
|
- uni.showModal({
|
|
|
- title: "提示",
|
|
|
- content: "确定保存到相册吗",
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- uni.downloadFile({
|
|
|
- url: this.$method.splitImgHost(item.invoiceImg, true, 1000), //图片地址
|
|
|
- success: (res) => {
|
|
|
- if (res.statusCode === 200 || res.statusCode === 400) {
|
|
|
- uni.saveImageToPhotosAlbum({
|
|
|
- filePath: res.tempFilePath,
|
|
|
- success: function () {
|
|
|
- uni.showToast({
|
|
|
- title: "保存成功",
|
|
|
- icon: "none",
|
|
|
- });
|
|
|
- },
|
|
|
- fail: function () {
|
|
|
- uni.showToast({
|
|
|
- title: "保存失败",
|
|
|
- icon: "none",
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
- } else if (res.cancel) {
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
+ download(this.$method.splitImgHost(item.invoiceImg));
|
|
|
},
|
|
|
},
|
|
|
computed: {
|