From 6898a19dcf7f52a1f93f8775cdfafc1685b4ee97 Mon Sep 17 00:00:00 2001 From: zhao_js <349234519@qq.com> Date: 星期四, 04 一月 2024 13:53:17 +0800 Subject: [PATCH] no message --- H5/pages/ad_page/product_sc.vue | 103 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 93 insertions(+), 10 deletions(-) diff --git a/H5/pages/ad_page/product_sc.vue b/H5/pages/ad_page/product_sc.vue index f51f385..b913ce5 100644 --- a/H5/pages/ad_page/product_sc.vue +++ b/H5/pages/ad_page/product_sc.vue @@ -5,8 +5,25 @@ size="mini">绱犳潗涓嬭浇</button> <button @click="toTab(2)" class="mini-btn" type="default" size="mini">鐭俊瀹℃牳</button> <button @click="toTab(3)" class="mini-btn" type="default" size="mini">寰俊鏈嬪弸鍦�</button> - </view> + </view> + <view style="display: flex;flex-wrap: wrap; padding: 0.5rem;justify-content:space-between;"> + <view style="display: flex;flex-wrap: wrap;"> + <button @click="tongbu()" style="margin-right: 0.2rem;" type="primary"> + 鍟嗗搧鍚屾 + </button> + <button @click="getCount()" style="margin-right: 0.2rem;" type="primary"> + 鏌ョ湅閾鸿揣鍗� + </button> + <button @click="clearHuo()" type="primary"> + 娓呴櫎閾鸿揣鍗� + </button> + </view> + + <view @click="refreshList()" class="refresh"> + 鍒锋柊 + </view> + </view> <cc-pullScroolView class="pullScrollView" ref="pullScroll" :enablePullDown="false" :back-top="false"> <view> <view v-if="productList.length>0" class="orders-list d-flex flex-column w-100" @@ -38,9 +55,15 @@ <view style="display: flex;"> <view style="display: flex;flex-wrap:wrap;" v-if="currentId==item.id"> - <view style="margin: 0.3rem;" v-for="(linkitem, linkindex) in currentLink" :key="linkindex"> + <view style="margin: 0.3rem;" + v-for="(linkitem, linkindex) in currentLink" :key="linkindex"> <button @click="download(linkitem)" type="primary"> - 涓嬭浇{{linkindex}} + 鍥剧墖{{linkindex}} + </button> + </view> + <view v-if="videoLink&&videoLink.length>0"> + <button @click="download(videoLink)" type="primary"> + 涓诲浘瑙嗛 </button> </view> </view> @@ -73,6 +96,7 @@ pageCount: 10, totalNum: 0, currentLink: [], + videoLink:'', currentId: '' } }, @@ -91,9 +115,50 @@ } }, methods: { - toPyq() { - uni.navigateTo({ - url: '/pages/ad_page/wx_pyqset' + //鍟嗗搧鍚屾 + tongbu() { + this.$http.post('/api/ProductManage/AddDistributebillTask', {}).then(e => { + if (e.result == true) { + uni.showToast({ + title: '鍚屾浠诲姟宸叉彁浜わ紝璇风◢鍚庡埛鏂伴〉闈�', + icon: 'none' + }); + } + + }).catch(function(err) { + console.log(err); + }) + }, + refreshList() { + this.productList = []; + this.getTemplateData(); + }, + //鏌ョ湅閾鸿揣鍗� + getCount() { + this.$http.post('/api/ProductInfo/DistributebillGet', {}).then(e => { + if (e.success == true) { + uni.showToast({ + title: '褰撳墠閾鸿揣鍗曞叡鏈�' + e.result + '浠跺晢鍝�', + icon: 'none' + }); + } + + }).catch(function(err) { + console.log(err); + }) + }, + //娓呴櫎閾鸿揣鍗� + clearHuo() { + this.$http.post('/api/ProductInfo/ClearDistributebill', {}).then(e => { + if (e.success == true) { + uni.showToast({ + title: '娓呴櫎鎴愬姛锛�', + icon: 'none' + }); + } + + }).catch(function(err) { + console.log(err); }) }, //妫�鏌ョ櫧鍚嶅崟 @@ -115,8 +180,9 @@ this.$http.post('/api/ProductInfo/GetDaiFaDetail', param).then(e => { var prodetail = e.result; var linkArr = prodetail.productImage.images; - linkArr.push(prodetail.mainVedio); + //linkArr.push(prodetail.mainVedio); this.currentLink = prodetail.productImage.images; + this.videoLink=prodetail.mainVedio; this.currentId = id; }).catch(function(err) { console.log(err); @@ -124,19 +190,26 @@ }, //涓嬭浇 download(link) { + uni.showLoading({ + title: '涓嬭浇涓�' + }) uni.downloadFile({ url: link, success: (res) => { + uni.hideLoading(); if (res.statusCode === 200) { - var oA = document.createElement("a"); + var oA = document.createElement("a"); oA.download = ''; // 璁剧疆涓嬭浇鐨勬枃浠跺悕锛岄粯璁ゆ槸'涓嬭浇' oA.href = res.tempFilePath; //涓存椂璺緞鍐嶄繚瀛樺埌鏈湴 document.body.appendChild(oA); oA.click(); - oA.remove(); // 涓嬭浇涔嬪悗鎶婂垱寤虹殑鍏冪礌鍒犻櫎 + oA.remove(); // 涓嬭浇涔嬪悗鎶婂垱寤虹殑鍏冪礌鍒犻櫎 */ } }, - fail: (res) => {} + fail: (res) => { + uni.hideLoading(); + + } }); }, toTab(tabtype) { @@ -199,6 +272,16 @@ width: 80%; } + .refresh { + display: flex; + align-items: center; + color: #fff; + background: #FF928F; + padding: 0.6rem; + border-radius: 10px; + font-size: 0.8rem; + } + .container { display: flex; flex-direction: column; -- Gitblit v1.9.3