Browse Source

买入订单页面

master
wanghongjun 2 years ago
parent
commit
89be01ba36
  1. 5
      api/order.js
  2. 103
      pages/user/order/buyOrder.vue
  3. 2
      uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue

5
api/order.js

@ -13,6 +13,7 @@ const api = {
ordquery:'AgencyAddress/order/queryRrder', //订单查询
getTicket:'AgencyAddress/order/getTicket', //发票管理
delOrder:'AgencyAddress/order/delOrder', //单资源,资源集数据显示
getDownsAddress:'AgencyAddress/OrderSource/getDownsAddress', //a标签下载文件资源
}
// 当前用户待处理的订单数量
@ -75,4 +76,8 @@ export function getSourceNewList(batchcode,user_isli,orderDetail) {
user_role: 1
}
return request.post(api.delOrder, data)
}
// 下载文件资源
export function getDownsAddress(data) {
return request.post(api.delOrder, data)
}

103
pages/user/order/buyOrder.vue

@ -92,6 +92,28 @@
</view>
</view>
</mescroll-body>
<view>
<!-- 普通弹窗 -->
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog :type="msgType" cancelText="取消" title="下载" content=""
@close="dialogClose">
<view class="popup-item" v-for="pItem in downList" style="border-bottom: 1px #e8e8e8 solid;margin-top: 5px">
<view>{{pItem.target_name}}</view>
<view>{{pItem.metadataFileFormat}}</view>
<view>{{pItem.metadataFileSize}}</view>
<view>{{pItem.status_name}}</view>
<view v-if="pItem.show_down"
class="popup-item-bt"
@click="handelTable(pItem.isliCode,pItem.metadataFileFormat)"
style="float: right;width: 60px;height: 25px;margin-top: -25px;background-color: #26587b;color: white;border-radius: 25px;"
>
<view class="popup-item-bt-down" style="text-align: center; margin-top: 3px;">下载</view>
<a ref="downloadLink" :href="downloadUrl" style="display:none" download></a>
</view>
</view>
</uni-popup-dialog>
</uni-popup>
</view>
</view>
</template>
@ -102,7 +124,8 @@
import { getEmptyPaginateObj, getMoreListData } from '@/core/app'
import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins'
import {getSourceNewList} from "../../../api/order";
import uniPopup from '../../../uni_modules/uni-popup/components/uni-popup/uni-popup';
import uniPopupDialog from '../../../uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog';
//
const pageSize = 10
@ -118,7 +141,9 @@
export default {
name: "buyOrder",
components: {
MescrollBody
MescrollBody,
uniPopup,
uniPopupDialog,
},
mixins: [MescrollMixin],
data() {
@ -146,7 +171,35 @@
},
// onShow
canReset: false,
downList: [],//
downList: [
{
target_name: 'target_name',
metadataFileFormat: 'metadataFileFormat',
metadataFileSize: 'metadataFileSize',
status_name: 'status_name',
show_down: 0,
},
{
target_name: 'target_name',
metadataFileFormat: 'metadataFileFormat',
metadataFileSize: 'metadataFileSize',
status_name: 'status_name',
isliCode: 'isliCode',
show_down: 1,
},
{
target_name: 'target_name',
metadataFileFormat: 'metadataFileFormat',
metadataFileSize: 'metadataFileSize',
status_name: 'status_name',
isliCode: 'isliCode',
show_down: 1,
}
],//
msgType: 'success',
source_download: [],
order_number: '', //
downloadUrl: '', //
}
},
/**
@ -273,6 +326,7 @@
handelDownload (index,batchcode,goods) {
let app = this
let source_download = goods.source_download
app.source_download = JSON.parse(source_download);
let isliCode = uni.getStorageSync("isliCode")
OrderApi.getSourceNewList(batchcode,isliCode,goods.goods_islicode).then(res => {
if (res.resultCode === "00000000") {
@ -289,7 +343,7 @@
}
targetData[targetData2.indexOf(JSON.parse(item.source_data).isliCode)].push(item);
});
app.order_number = batchcode
app.query_type(source_download,targetData,sourceData);
} else {
@ -376,7 +430,48 @@
}
app.downList.push(tempArr)
})
app.msgType = 'success'
app.$refs.alertDialog.open()
},
//
handelTable(islicode, copyTarget) {
const app = this
if (islicode != undefined) {
let DemoArray = app.source_download
DemoArray.myForEach(function (v, index, arr) {
if (v.islicode == islicode) {
if (v.url) {
app.downloadUrl = v.url
const downloadLink = app.$refs.downloadLink;
downloadLink.click();
downloadFile(v.url, '资源下载', v.islicode);
} else {
app.$error('解密中')
}
}
})
}
},
//
downloadFile(url, name, islicode) {
const app = this
let data = {
batchcode: app.order_number, //
dowUrl: url, //
isliCode: islicode, //ISLI
sourceStatus: 0, //0 1 2: 3
userId: uni.getStorageSync("isliCode") //ISLI
}
OrderApi.getDownsAddress(data).then(res => {
if (res.resultCode === "00000000") {
app.$success("下载成功");
} else {
app.app.error(res.resultMsg);
}
})
},
dialogClose() {console.log('点击关闭')},
//
getTabValue() {
return this.tabs[this.curTab].value

2
uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue

@ -197,7 +197,7 @@
.uni-dialog-content {
/* #ifndef APP-NVUE */
display: flex;
display: block;
/* #endif */
flex-direction: row;
justify-content: center;

Loading…
Cancel
Save