@@ -144,234 +37,50 @@ import { Https } from "@/tool/https";
import { formatTime } from "@/tool/util";
import { Modal, message } from "ant-design-vue";
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
+import allOrder from "@/component/Pay/allOrder.vue";
+import creditsDetail from "@/component/Pay/creditsDetail.vue";
import { useI18n } from "vue-i18n";
export default defineComponent({
components: {
+ creditsDetail,
+ allOrder,
},
setup() {
- let rangePickerValue: any = ref([]);
- let renameData: any = ref({}); //修改名字选中的数据
- const columns: any = computed(() => {
- return [
- {
- title: "Serial",
- align: "center",
- ellipsis: true,
- width: 90,
- dataIndex: "orderNo",
- key: " ",
- },
- {
- title: "Title",
- align: "center",
- ellipsis: true,
- width: 90,
- dataIndex: "title",
- key: "sketchCounts",
- },
- // { title: useI18n().t('HistoryPage.UptateTime'), align:'center', ellipsis: true,width: 90, dataIndex: 'updateDate', key: 'updateTime',customRender:(record:any)=>{
- // // let time = formatTime(record.text / 1000, 'YYYY-MM-DD hh:mm:ss')
- // return record.record.updateTime
- // }},
- {
- title: "Money",
- align: "center",
- ellipsis: true,
- width: 90,
- dataIndex: "totalFee",
- key: "sketchCounts",
- },
- {
- title: "Payment",
- align: "center",
- ellipsis: true,
- width: 90,
- dataIndex: "paymentType",
- key: "sketchCounts",
- },
- {
- title: "State",
- align: "center",
- ellipsis: true,
- width: 90,
- dataIndex: "orderStatus",
- key: "sketchCounts",
- },
-
- {
- title: useI18n().t("HistoryPage.Operations"),
- key: "operation",
- align: "center",
- fixed: "left",
- width: 90,
- // slots:{customRender:'action'}
- Operations: true,
- },
- ];
- });
+ let presentState: any = ref('paypal');
let showPayOrder: any = ref(false);
- let showRefundReason: any = ref(false);
- let collectionList: any = ref([]);
- let record: any = ref();//订单编号
- let reason: any = ref('noLike');//原因
- let reasonTextarea: any = ref();//原因
let loadingShow: any = ref(false);//原因
let { t } = useI18n();
return {
- rangePickerValue,
- columns,
- collectionList,
+ presentState,
showPayOrder,
- showRefundReason,
- record,
- reason,
- reasonTextarea,
- renameData,
loadingShow,
t,
};
},
data() {
return {
- currentPage: 1,
- pageSize: 10,
- total: 0,
- historyTableHeight: 0,
- newCollectionName: "",
- groupDetails: {}, //每个collection的详情
- collectionName: "", //选中的名字
- searchCollectionName: "",
};
},
mounted() {},
methods: {
init() {
this.showPayOrder = true;
- this.getHistoryList();
- nextTick().then(() => {
- let history_table_content = document.getElementsByClassName(
- "history_table_content"
- )[0];
- this.historyTableHeight =
- history_table_content.scrollHeight - 130;
- });
},
- cancelDsign() {//关闭订单页面
- this.showPayOrder = false;
- },
- cancelRefundreason(){//关闭退款页面
- this.record = ''
- this.showRefundReason = false;
- },
- //改变页码
- changePage(e: any) {
- this.currentPage = e.current;
- this.pageSize = e.pageSize;
- this.getHistoryList();
- },
-
- //查询列表
- searchHistoryList() {
- this.currentPage = 1;
- this.getHistoryList();
- },
-
- getHistoryList() {
- let startDate: any = this.rangePickerValue
- ? new Date(this.rangePickerValue[0]).getTime()
- : "";
- let endDate: any = this.rangePickerValue
- ? new Date(this.rangePickerValue[1]).getTime()
- : "";
- let data = {
- page: this.currentPage,
- size: this.pageSize,
- collectionName: this.searchCollectionName,
- startDate: startDate,
- endDate: endDate,
- };
-
- Https.axiosGet(Https.httpUrls.orderInfoList).then((rv: any) => {
- this.total = rv.length;
- this.collectionList = rv.slice(
- (this.currentPage - 1) * this.pageSize,
- (this.currentPage - 1) * this.pageSize + this.pageSize
- );
-
- });
- // Https.axiosPost( Https.httpUrls.queryUserGroup, data).then(
- // (rv: any) => {
- // this.collectionList = rv.content
- // this.total = rv.total
- // }
- // );
- },
-
- //删除分组
- // deleteGroup(record:any,index:number){
- // let deleteGroupFun = (id:any,index:number) =>{
- // let data = {
- // userGroupId:id
- // }
- // Https.axiosPost(Https.httpUrls.deleteUserGroup,data).then(
- // (rv: any) => {
- // message.success(this.t('HistoryPage.jsContent1'))
- // this.collectionList.splice(index,1)
- // }
- // );
- // }
- // Modal.confirm({
- // title: this.t('HistoryPage.jsContent2'),
- // icon: createVNode(ExclamationCircleOutlined),
- // okText: 'Yes',
- // cancelText: 'No',
- // centered:true,
- // mask:false,
- // onOk() {
- // deleteGroupFun(record.id,index)
- // }
- // });
- // },
-
- refund(record: any) {
- // this.$router.push({name:'home',params: {id:record.id}})
- this.record = record
- this.showRefundReason = true
- },
- getReasonCategory(){
- if(this.reason == 'Rests'){
+ setState(str:any){
+ this.presentState = str
+ let setInit:any
+ if(str == 'paypal'){
+ setInit = this.$refs.creditsDetail
}else{
- this.reasonTextarea = ''
+ setInit = this.$refs.allOrder
}
- },
- setReason(){
- let reason = this.reason
- this.loadingShow = true
- if(this.reason == 'Rests'){
- reason = this.reasonTextarea?this.reasonTextarea:this.reason
- }
-
- // return
-
- let httpsUrl = Https.httpUrls.tradeRefundAlipay
- if(this.record.paymentType == "PayPal"){
- httpsUrl = Https.httpUrls.tradeRefundPaypal
- }
- Https.axiosPost(
- httpsUrl + `/${this.record.orderNo}/${reason}`,
- {}
- ).then((rv: any) => {
- this.getHistoryList()
- this.loadingShow = false
- this.showRefundReason = false
- })
- .catch((res) => {});
- },
+ setInit.init()
+ }
},
});
\ No newline at end of file
diff --git a/src/component/Pay/refund.vue b/src/component/Pay/refund.vue
new file mode 100644
index 00000000..05d03551
--- /dev/null
+++ b/src/component/Pay/refund.vue
@@ -0,0 +1,216 @@
+
+
+
+
+
+
+
+ Refund Reason
+
+
+ OK
+
+
+
+
+
\ No newline at end of file
diff --git a/src/router/index.ts b/src/router/index.ts
index 48519be6..510dd0b9 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -117,11 +117,10 @@ router.beforeEach((to, from, next) => {
let token = getCookie("token");
let isMurmur = JSON.parse(getIsMurmur)
let routeList = ['/testClickData','/trialApproval']//指定页面需要指定id才能进入
- let userIdList = [83,88,6]
+ let userIdList = [83,88,6,87]
const routeExists = router.getRoutes().some(({ name }) =>{
if(name){
- console.log(name , to.name);
- return name === to.name
+ return name === to.name
}else{
return false
}
@@ -141,7 +140,7 @@ router.beforeEach((to, from, next) => {
if(userIdList.indexOf(userInfo.userId) > -1){
next();
}else{
- next({ name: 'home' });
+ next({ name: '/404' });
}
}else{
next();
diff --git a/src/tool/util.js b/src/tool/util.js
index 9dbc18f6..ab787ec8 100644
--- a/src/tool/util.js
+++ b/src/tool/util.js
@@ -1,5 +1,5 @@
import Fingerprint2 from 'fingerprintjs2';//获取浏览器唯一标识
-const isEmail = (email) => {
+const isEmail = (email) => {//判断邮箱格式
let reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/
let result = reg.test(email)
return result
@@ -11,7 +11,7 @@ const getUploadUrl = () => {
return url
}
-function dataURLtoBlob(dataurl) {
+function dataURLtoBlob(dataurl) {//吧data url转为blob对象
var arr = dataurl.split(',');
var mime = arr[0].match(/:(.*?);/)[1];
var bstr = atob(arr[1]);
@@ -23,7 +23,7 @@ function dataURLtoBlob(dataurl) {
return new Blob([u8arr], { type: mime });
}
-function blobToFile(blob, fileName) {
+function blobToFile(blob, fileName) {//给blob文件设置名字和日期
blob.lastModifiedDate = new Date();
blob.name = fileName;
return blob;
@@ -51,7 +51,7 @@ function downloadIamge(imgsrc, name) { // 下载图片地址和图片名
image.src = imgsrc
}
-function dataURLtoFile(dataurl, filename) {
+function dataURLtoFile(dataurl, filename) {//吧url转为文件对象,指定文件名称
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while (n--) {
@@ -61,7 +61,7 @@ function dataURLtoFile(dataurl, filename) {
return blobToFile(blob, filename);
}
-const base64toFile = (dataurl, filename = 'file') => {
+const base64toFile = (dataurl, filename = 'file') => {//转换base64
let arr = dataurl.split(',')
let mime = arr[0].match(/:(.*?);/)[1]
let suffix = mime.split('/')[1]
@@ -77,7 +77,7 @@ const base64toFile = (dataurl, filename = 'file') => {
}
-function rgbToHsv([R, G, B]) {
+function rgbToHsv([R, G, B]) {//根据rgb获取hsv
R /= 255
G /= 255
B /= 255
@@ -108,7 +108,7 @@ function rgbToHsv([R, G, B]) {
return [H, S, V]
}
-const formatTime = (timestamp, fmt) => {
+const formatTime = (timestamp, fmt) => {//吧时间戳转为YYYY-MM-DD hh:mm:ss格式
// date = new Date(), fmt = 'MM/dd/yyyy';
let date = new Date();
date.setTime(timestamp * 1000);
@@ -146,7 +146,7 @@ const formatTime = (timestamp, fmt) => {
return fmt;
}
-const isMoible = () => {
+const isMoible = () => {//判断是否是移动端
let is_mobile = navigator.userAgent.toLowerCase().match(/(ipad|ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null;
// alert(navigator.userAgent.toLowerCase())
var isiPad = /iPad/.test(navigator.platform) || (navigator.maxTouchPoints && navigator.maxTouchPoints > 2);
@@ -184,7 +184,7 @@ function getBrowserInfo() {//获取是什么浏览器
return agent.match(regStr_saf);
}
}
-async function murmur(){
+async function murmur(){//生成唯一标识 ,暂时没有使用
return await new Promise((resolve,reject)=>{
Fingerprint2.get(function (components) {
const values = components.map(function (
diff --git a/src/views/Administrator.vue b/src/views/Administrator.vue
index bc67adc0..b4064d6b 100644
--- a/src/views/Administrator.vue
+++ b/src/views/Administrator.vue
@@ -104,14 +104,14 @@ export default defineComponent({
// },
// ],
},{
- name:'Trial User Approval',
+ name:'Design Frequency',
route:'/administrator/testClickData',
icon:'shenpi',
expandIcon:'icon-xiala',
key:'/administrator/testClickData',
isShow:true,
},{
- name:'Design Frequency',
+ name:'Trial User Approval',
route:'/administrator/trialApproval',
icon:'usetime',
key:'/administrator/trialApproval',
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index 2f60ac60..42c46e31 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -1010,126 +1010,6 @@ export default defineComponent({
let exportModel:any = this.$refs.ExportModel
exportModel.init()
},
- //导出合成图
- // async exportCanvas() {
- // let collectionReview: any = document.querySelector(
- // "#exportNewCoolection"
- // );
- // let rightContentImgBlock: any = document.querySelector(
- // "#right_content_img_block"
- // );
- // if(this.driver__.driver){
- // nextTick().then(()=>{
- // driverObj__.moveNext();
- // })
- // }
-
- // let a = document.createElement("a");
- // // this.isShowMark = true;
- // let img:any = []
- // await html2canvas(collectionReview, { useCORS: true, scale: 3 }).then(
- // async (canvas) => {
- // let blob: any = dataURLtoBlob(
- // canvas.toDataURL("image/png")
- // );
- // let allBoardData: any =
- // this.store.state.UploadFilesModule.allBoardData;
- // let index = 0;
- // img.push({
- // imgUrl: URL.createObjectURL(blob),
- // name: "collection.png",
- // })
- // let num = 0
- // for (let key in allBoardData) {
- // if (key !== "colorBoards" && key !== "moodTemplateId") {
- // if(this.exportNav[num]?.change || key == 'disposeMoodboard'){
- // for (let item of allBoardData[key]) {
- // if(key == 'disposeMoodboard' && allBoardData[key][0]==undefined){
- // break
- // }
- // let nameTail = item?.imgUrl?.split(".").pop().split("?").shift();
- // let data = {
- // imgUrl: item.imgUrl,
- // name:
- // item?.resData?.name +
- // index +
- // "." +
- // nameTail,
- // };
- // img.push(data);
- // index++;
- // }
- // }else{
- // }
- // num++
- // }
- // }
- // let dataList:any = []
- // this.likeDesignCollectionList.forEach((item:any)=>{
- // let nameTail = item?.designOutfitUrl?.split(".").pop().split("?").shift();
- // let data = {
- // imgUrl: item.designOutfitUrl,
- // name:
- // 'result' +
- // index +
- // "." +
- // nameTail,
- // };
- // dataList.push(item.designItemId)
- // img.push(data);
- // index++;
- // })
- // let mannequinList:any = []
- // await Https.axiosPost(Https.httpUrls.designGetModel, dataList)
- // .then((rv: any) => {
- // mannequinList = rv
- // })
- // .catch((rv) => {
- // });
-
- // mannequinList.forEach((item:any) => {
- // let nameTail = item?.split(".").pop().split("?").shift();
- // let data = {
- // imgUrl: item,
- // name:
- // 'mannequin' +
- // index +
- // "." +
- // nameTail,
- // };
- // img.push(data);
- // index++;
- // });
- // // a.setAttribute('href', URL.createObjectURL(blob));
- // // a.setAttribute('download', `collection.png`);
- // // a.click();
- // }
- // );
- // //单独导出模特图
- // // await html2canvas(rightContentImgBlock, { useCORS: true, scale: 3 }).then(
- // // (canvas) => {
- // // let blob: any = dataURLtoBlob(
- // // canvas.toDataURL("image/png")
- // // );
- // // let allBoardData: any =
- // // this.store.state.UploadFilesModule.allBoardData;
- // // let index = 0;
- // // img.push({
- // // imgUrl: URL.createObjectURL(blob),
- // // name: "achievement.png",
- // // },)
- // // this.likeDesignCollectionList.forEach((item:any) => {
- // // let data = {
- // // imgUrl:item.designItemUrl,
- // // name:item.pictureName
- // // }
- // // img.push(data)
- // // });
- // // }
- // // );
- // // return
- // this.downImg(img);
- // },
//打开图片详情
designDetail(
@@ -1166,54 +1046,6 @@ export default defineComponent({
});
}
},
-
- //通过url 转为blob格式的数据
- getImgArrayBuffer(url: any) {
-
- return new Promise((resolve, reject) => {
- //通过请求获取文件blob格式
- let xmlhttp = new XMLHttpRequest();
- xmlhttp.open("GET", url, true);
- xmlhttp.responseType = "blob";
- xmlhttp.onload = function () {
- if (this.status == 200) {
- resolve(this.response);
- } else {
- reject(this.status);
- }
- };
- xmlhttp.send();
- });
- },
- // imgDataUrl 数据的url数组
- // downImg(imagesParams: any) {
- // let _this: any = this;
- // let zip = new JSZip();
- // let cache: any = {};
- // let promises = [];
- // for (let item of imagesParams) {
- // const promise = _this
- // .getImgArrayBuffer(item.imgUrl)
- // .then((data: any) => {
- // // 下载文件, 并存成ArrayBuffer对象(blob)
- // zip.file(item.name, data, { binary: true }); // 逐个添加文件
- // cache[item.title] = data;
- // });
- // promises.push(promise);
- // }
- // Promise.all(promises)
- // .then(() => {
- // zip.generateAsync({ type: "blob" }).then((content: any) => {
- // // 生成二进制流
- // FileSaver.saveAs(content, "DesignFiles"); // 利用file-saver保存文件 自定义文件名
- // this.isShowMark = false;
- // });
- // })
- // .catch((res) => {
- // message.warning(this.t('HomeView.jsContent3'));
- // this.isShowMark = false;
- // });
- // },
},
});