From df1bad0a319e196279b888ad6020c4f3f9b0fe43 Mon Sep 17 00:00:00 2001 From: cmxdd <86407334@qq.com> Date: Wed, 5 Aug 2020 17:42:06 +0800 Subject: [PATCH 1/3] update other api --- common/http.api.js | 34 +++ components/order-item/index.vue | 6 +- components/order-item/testlist.vue | 13 +- pages.json | 11 + pages/index/details.vue | 440 +++++++++++++++++++++++----- pages/index/index.vue | 19 +- pages/index/otherdetails.vue | 399 ++++++++++++++++++++++++++ pages/login/login.vue | 2 +- pages/release/index.vue | 98 ++++--- pages/release/video.vue | 441 +++++++++++++++++++++-------- 10 files changed, 1217 insertions(+), 246 deletions(-) create mode 100644 pages/index/otherdetails.vue diff --git a/common/http.api.js b/common/http.api.js index 5949753..fca217b 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -97,6 +97,40 @@ const install = (Vue, vm) => { canselectgood(){ return vm.$u.post("/article/getStoreGoodsList") }, + // 发布图文 + publishphoto({article_title,article_content,article_pic,file_id,goods_id_arr,label_arr}){ + return vm.$u.post("/article/publishImage",{article_title,article_content,article_pic,file_id,goods_id_arr,label_arr}) + }, + // 发布视频 + publishvideo({article_title,article_content,article_pic,video_path,goods_id_arr,label_arr}){ + return vm.$u.post("/article/publishVideo",{article_title,article_content,article_pic,video_path,goods_id_arr,label_arr}) + }, + // 订单详情 + orderdetail({order_id}){ + return vm.$u.post("/Order/orderInfo",{order_id}) + }, + // 试穿订单详情 + testorderdetail({goods_try_id}){ + return vm.$u.post("/order/goodsTryOrderInfo",{goods_try_id}) + }, + // 绑定物流订单 + bindpushid({order_id,shipping_code,shipping_express_id}){ + return vm.$u.post("/order/send",{order_id,shipping_code,shipping_express_id}) + }, + // 绑定骑手 + bindcarer({order_id,takeawayer_id}){ + return vm.$u.post("/order/orderRider",{order_id,takeawayer_id}) + }, + // 发货物流公司 + pushcompany(){ + return vm.$u.post("/order/getExpress") + }, + // 退款退货 + refund({refund_id,seller_state,seller_message}){ + return vm.$u.post("/order/editRefund",{refund_id,seller_state,seller_message}) + }, + + } // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 vm.$u.api = api; diff --git a/components/order-item/index.vue b/components/order-item/index.vue index 8ab7382..2192fd1 100644 --- a/components/order-item/index.vue +++ b/components/order-item/index.vue @@ -6,14 +6,14 @@ 编号:{{info.order_sn}} - + 待处理订单 已发货订单 已完成订单 申请退款订单 已退款订单 + 拒绝退款订单 - {{info.extend_order_goods[0].goods_name}} 共{{info.extend_order_goods[0].goods_num}}件商品 @@ -34,7 +34,7 @@ export default { methods: { toDetailsPage() { uni.navigateTo({ - url: '/pages/index/details?id=' + this.info.order_id + url: '/pages/index/details?id=' + this.info.order_id+"&type="+this.info.view_type }); }, }, diff --git a/components/order-item/testlist.vue b/components/order-item/testlist.vue index 8f8db9f..03f967d 100644 --- a/components/order-item/testlist.vue +++ b/components/order-item/testlist.vue @@ -29,8 +29,19 @@ export default { }, methods: { toDetailsPage() { + let type =0 + let info = this.info + if(info.goods_try_order_status==0){ + type=1 + }else if(info.goods_try_order_status==20){ + type=2 + }else if(info.goods_try_order_status==40){ + type=3 + }else if(info.goods_try_order_status==50){ + type=4 + } uni.navigateTo({ - url: '/pages/index/details?id=' + this.info.order_id + url: '/pages/index/otherdetails?id=' + this.info.goods_try_id+"&type="+type }); }, }, diff --git a/pages.json b/pages.json index ec1fa82..d60307e 100644 --- a/pages.json +++ b/pages.json @@ -59,6 +59,17 @@ } } } + }, + { + "path": "pages/index/otherdetails", + "style": { + "navigationBarTitleText": "试穿订单详情", + "app-plus": { + "titleNView": { + "titleColor": "#333333" + } + } + } }, { "path": "pages/release/video", diff --git a/pages/index/details.vue b/pages/index/details.vue index 56f7486..3072463 100644 --- a/pages/index/details.vue +++ b/pages/index/details.vue @@ -1,62 +1,70 @@ @@ -120,7 +121,8 @@ export default { scrollTop: 0, imgarr: [], //上传图片数组 cover: '', //图文封面 - selectarr: [] //选中标签 + selectarr: [], //选中标签 + tagcontent: '' }; }, onLoad() { @@ -129,13 +131,37 @@ export default { this.getLiveSpec(); }, methods: { - publish(){ - console.log(this.imgarrA) - console.log(this.imgarrB) - console.log(this.selectarr) - console.log(this.form) - console.log(this.shoplist) - console.log(this.arres_list) + publish() { + let arr = this.imgarrB; + let newarr = []; + for (let index in arr) { + newarr.push(arr[index].file_id); + } + this.$u.api.publishphoto({ + article_title: this.form.name, + article_content: this.form.intro, + article_pic: this.imgarrA[0].file_name, + file_id: newarr, + goods_id_arr: this.arres_list, + label_arr: this.selectarr + }).then(res => { + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.$refs.uToast.show({ + title: res.message, + type: 'success' + }); + setTimeout(function(){ + uni.navigateBack({ + delta:1 + }) + },1000) + } + }); }, // 获取商品数组变化 getshoplist() { @@ -149,24 +175,22 @@ export default { } } } - console.log(this.shoplist); }, // 改变选中状态 changeselect(num) { if (this.fileListes[num].state == true) { this.fileListes[num].state = false; - that.arres_list.splice(this.fileListes[num].id, 1); + let index = this.selectarr.indexOf(this.fileListes[num].id); + this.selectarr.splice(index, 1); } else { this.fileListes[num].state = true; this.selectarr.push(this.fileListes[num].id); } - console.log(this.selectarr); }, // 获取标签 getLiveSpec() { let that = this; this.$u.api.getLiveSpec({}).then(res => { - console.log(res); if (res.errCode != 0) { this.$refs.uToast.show({ title: res.message, @@ -177,43 +201,49 @@ export default { for (let index in arr) { arr[index].state = false; } - console.log(arr); that.fileListes = arr; } }); }, // 创建标签 addLiveSpec() { - this.$u.api.createLivesp({}).then(res => { - console.log(res); - if (res.data.live_stataes == 0) { - this.$u.route({ - url: `/pages/${url}` - }); - } else { - } - }); + this.$u.api + .createLivesp({ + spec_name: this.tagcontent + }) + .then(res => { + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.tagcontent = ''; + this.show = false; + this.$refs.uToast.show({ + title: res.message, + type: 'success' + }); + } + }); }, // 上传封面 uploadcover(data) { - let obj = data.data - obj.url = obj.file_path - this.imgarrA.push(obj) + let obj = data.data; + obj.url = obj.file_path; + this.imgarrA.push(obj); }, // 上传图片 uploadphoto(data) { - console.log(data) - let obj = data.data - obj.url = obj.file_path - this.imgarrB.push(obj) + let obj = data.data; + obj.url = obj.file_path; + this.imgarrB.push(obj); }, changes() { let that = this; that.show_two = false; - console.log(that.arres_list); }, show_add() { - console.log(this.show); this.show = !this.show; }, // 选中某个复选框时,由checkbox时触发 @@ -224,7 +254,6 @@ export default { } else { this.delarr(id); } - console.log(this.arres_list); }, // 删除直播商品 delarr(id) { @@ -248,7 +277,6 @@ export default { } }, tosign() { - console.log('111'); this.$u.api.canselectgood({}).then(res => { if (res.data.live_stataes == 0) { this.$u.route({ diff --git a/pages/release/video.vue b/pages/release/video.vue index da2a9b6..d995935 100644 --- a/pages/release/video.vue +++ b/pages/release/video.vue @@ -1,27 +1,42 @@ \ No newline at end of file + -- 2.45.2 From 80e3a721a16cfc443b0e710b81d34a7bdff634fb Mon Sep 17 00:00:00 2001 From: cmxdd <86407334@qq.com> Date: Wed, 5 Aug 2020 20:10:55 +0800 Subject: [PATCH 3/3] formatted style --- pages/index/details.vue | 216 +++++++++++++++++------------------ pages/index/otherdetails.vue | 88 +++++++------- pages/release/index.vue | 36 +++--- pages/release/video.vue | 36 +++--- 4 files changed, 177 insertions(+), 199 deletions(-) diff --git a/pages/index/details.vue b/pages/index/details.vue index 64d148e..e9d40da 100644 --- a/pages/index/details.vue +++ b/pages/index/details.vue @@ -182,49 +182,45 @@ export default { if (this.cur == 0) { // 确定退款 return; - this.$u.api - .refund({ - refund_id: this.orderid, - seller_state:2, - seller_message:"" - }) - .then(res => { - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - this.$refs.uToast.show({ - title: res.message, - type: 'success' - }); - console.log(res); - } - }); + this.$u.api.refund({ + refund_id: this.orderid, + seller_state:2, + seller_message:"" + }).then(res => { + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.$refs.uToast.show({ + title: res.message, + type: 'success' + }); + console.log(res); + } + }); } else { // 不进行退款 return; - this.$u.api - .refund({ - refund_id: this.orderid, - seller_state:3, - seller_message:"" - }) - .then(res => { - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - this.$refs.uToast.show({ - title: res.message, - type: 'success' - }); - console.log(res); - } - }); + this.$u.api.refund({ + refund_id: this.orderid, + seller_state:3, + seller_message:"" + }).then(res => { + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.$refs.uToast.show({ + title: res.message, + type: 'success' + }); + console.log(res); + } + }); } }, // 同意退款 @@ -239,24 +235,22 @@ export default { }, // 获取物流信息 getcarinfo() { - this.$u.api - .getpushinfo({ - order_id: this.orderid - }) - .then(res => { - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - this.$refs.uToast.show({ - title: res.message, - type: 'success' - }); - console.log(res); - } - }); + this.$u.api.getpushinfo({ + order_id: this.orderid + }).then(res => { + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.$refs.uToast.show({ + title: res.message, + type: 'success' + }); + console.log(res); + } + }); }, // 选择快递公司 getselectcompany(e) { @@ -268,48 +262,44 @@ export default { confirmpushstyle() { if (this.cur == 0) { console.log(this.pushid); - this.$u.api - .bindpushid({ - order_id: this.orderid, - shipping_code: this.pushid, - shipping_express_id: this.companyidA - }) - .then(res => { - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - this.$refs.uToast.show({ - title: res.message, - type: 'success' - }); - uni.navigateBack({ - delta: 1 - }); - } - }); + this.$u.api.bindpushid({ + order_id: this.orderid, + shipping_code: this.pushid, + shipping_express_id: this.companyidA + }).then(res => { + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.$refs.uToast.show({ + title: res.message, + type: 'success' + }); + uni.navigateBack({ + delta: 1 + }); + } + }); } else { - this.$u.api - .bindcarer({ - order_id: this.orderid, - takeawayer_id: this.selctcar.takeawayer_id - }) - .then(res => { - console.log(res); - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - this.$refs.uToast.show({ - title: res.message, - type: 'success' - }); - } - }); + this.$u.api.bindcarer({ + order_id: this.orderid, + takeawayer_id: this.selctcar.takeawayer_id + }).then(res => { + console.log(res); + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.$refs.uToast.show({ + title: res.message, + type: 'success' + }); + } + }); } }, // 选择骑手 @@ -318,21 +308,19 @@ export default { }, // 获取订单信息 resetinfo() { - this.$u.api - .orderdetail({ - order_id: this.orderid - }) - .then(res => { - console.log(res); - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - this.info = res.data; - } - }); + this.$u.api.orderdetail({ + order_id: this.orderid + }).then(res => { + console.log(res); + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.info = res.data; + } + }); this.$u.api.takeawayerlist({}).then(res => { console.log(res); if (res.errCode != 0) { diff --git a/pages/index/otherdetails.vue b/pages/index/otherdetails.vue index 3f9ba6f..27f360a 100644 --- a/pages/index/otherdetails.vue +++ b/pages/index/otherdetails.vue @@ -123,39 +123,35 @@ export default { // 绑定配送方式 confirmpushstyle() { if (this.cur == 0) { - this.$u.api - .agreetest({ - goods_try_id: this.orderid, - type: 1, - takeawayer_id: 0 - }) - .then(res => { - console.log(res); - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - } - }); + this.$u.api.agreetest({ + goods_try_id: this.orderid, + type: 1, + takeawayer_id: 0 + }).then(res => { + console.log(res); + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + } + }); } else { - this.$u.api - .agreetest({ - goods_try_id: this.orderid, - type: 1, - takeawayer_id: this.selctcar.takeawayer_id - }) - .then(res => { - console.log(res); - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - } - }); + this.$u.api.agreetest({ + goods_try_id: this.orderid, + type: 1, + takeawayer_id: this.selctcar.takeawayer_id + }).then(res => { + console.log(res); + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + } + }); } }, // 选择骑手 @@ -164,21 +160,19 @@ export default { }, // 获取订单信息 resetinfo() { - this.$u.api - .testorderdetail({ - goods_try_id: this.orderid - }) - .then(res => { - console.log(res); - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - this.info = res.data.info; - } - }); + this.$u.api.testorderdetail({ + goods_try_id: this.orderid + }).then(res => { + console.log(res); + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.info = res.data.info; + } + }); // 获取骑手列表 this.$u.api.takeawayerlist({}).then(res => { console.log(res); diff --git a/pages/release/index.vue b/pages/release/index.vue index 12245b8..ef217e0 100644 --- a/pages/release/index.vue +++ b/pages/release/index.vue @@ -207,25 +207,23 @@ export default { }, // 创建标签 addLiveSpec() { - this.$u.api - .createLivesp({ - spec_name: this.tagcontent - }) - .then(res => { - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - this.tagcontent = ''; - this.show = false; - this.$refs.uToast.show({ - title: res.message, - type: 'success' - }); - } - }); + this.$u.api.createLivesp({ + spec_name: this.tagcontent + }).then(res => { + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.tagcontent = ''; + this.show = false; + this.$refs.uToast.show({ + title: res.message, + type: 'success' + }); + } + }); }, // 上传封面 uploadcover(data) { diff --git a/pages/release/video.vue b/pages/release/video.vue index d995935..8b7c613 100644 --- a/pages/release/video.vue +++ b/pages/release/video.vue @@ -184,25 +184,23 @@ export default { }, // 创建标签 addLiveSpec() { - this.$u.api - .createLivesp({ - spec_name: this.tagcontent - }) - .then(res => { - if (res.errCode != 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'error' - }); - } else { - this.tagcontent = ''; - this.show = false; - this.$refs.uToast.show({ - title: res.message, - type: 'success' - }); - } - }); + this.$u.api.createLivesp({ + spec_name: this.tagcontent + }).then(res => { + if (res.errCode != 0) { + this.$refs.uToast.show({ + title: res.message, + type: 'error' + }); + } else { + this.tagcontent = ''; + this.show = false; + this.$refs.uToast.show({ + title: res.message, + type: 'success' + }); + } + }); }, // 获取标签 getLiveSpec() { -- 2.45.2