From fc9bd6378d3bfbde6d5c71535757a3d44de8d8ff Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期四, 20 七月 2023 15:18:06 +0800 Subject: [PATCH] Merge branch 'feature/1.1.4开发' into develop --- uniapp/uni_modules/uni-transition/changelog.md | 22 uniapp/pages/index/launchPage.vue | 3 uniapp/pages/login/login.vue | 29 uniapp/uni_modules/uni-scss/styles/setting/_color.scss | 66 + uniapp/pages/login/bindingPhone.vue | 11 uniapp/uni_modules/uni-scss/changelog.md | 8 uniapp/pages/rankinglist/fengqiang.vue | 22 uniapp/static/images/tabBar/compareprice.png | 0 uniapp/uni_modules/uni-scss/styles/setting/_radius.scss | 55 uniapp/uni_modules/uni-transition/components/uni-transition/createAnimation.js | 131 ++ uniapp/pages/mine/mt.vue | 3 uniapp/uni_modules/uni-scss/styles/tools/functions.scss | 19 uniapp/uni_modules/uni-scss/styles/setting/_variables.scss | 146 ++ uniapp/pages/active/specialOffer.vue | 57 uniapp/uni_modules/uni-scss/styles/setting/_space.scss | 56 uniapp/uni_modules/uni-popup/changelog.md | 68 + uniapp/pages.json | 30 uniapp/uni_modules/uni-popup/components/uni-popup/keypress.js | 45 uniapp/uni_modules/uni-popup/components/uni-popup/i18n/index.js | 8 uniapp/uni_modules/uni-transition/components/uni-transition/uni-transition.vue | 286 ++++ uniapp/utils/http.api.js | 10 uniapp/uni_modules/uni-scss/theme.scss | 31 uniapp/static/images/app/pushlogo.png | 0 uniapp/uni_modules/uni-scss/styles/setting/_styles.scss | 167 ++ uniapp/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json | 7 uniapp/uni_modules/uni-scss/styles/index.scss | 7 uniapp/pages/login/wxlogin.vue | 12 uniapp/pages/search/searchResult.vue | 3 uniapp/uni_modules/uni-popup/components/uni-popup/popup.js | 26 uniapp/uni_modules/uni-popup/readme.md | 17 uniapp/pages/rankinglist/common_transfer.vue | 96 + uniapp/uni_modules/uni-transition/readme.md | 11 uniapp/uni_modules/uni-popup/components/uni-popup/uni-popup.vue | 473 +++++++ uniapp/components/indexPage.vue | 232 +++ uniapp/pages/rankinglist/compareprice.vue | 163 ++ uniapp/uniCloud-aliyun/cloudfunctions/getPhoneNumber/index.js | 10 uniapp/uni_modules/uni-popup/package.json | 87 + uniapp/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue | 187 +++ uniapp/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue | 143 ++ uniapp/uni_modules/uni-scss/readme.md | 4 uniapp/uni_modules/uni-scss/variables.scss | 62 + uniapp/App.vue | 51 uniapp/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json | 7 uniapp/utils/utils.js | 23 uniapp/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js | 45 uniapp/uni_modules/uni-transition/package.json | 84 + uniapp/uni_modules/uni-scss/styles/setting/_border.scss | 3 uniapp/uni_modules/uni-scss/index.scss | 1 uniapp/uni_modules/uni-popup/components/uni-popup/i18n/en.json | 7 uniapp/components/pddremind.vue | 7 uniapp/uni_modules/uni-scss/package.json | 82 + uniapp/utils/getClipboard.js | 21 uniapp/pages/search/search.vue | 4 uniapp/uni_modules/uni-scss/styles/setting/_text.scss | 24 uniapp/manifest.json | 17 uniapp/pages/goods/goodsDetail.vue | 130 + uniapp/pages/mine/elm.vue | 2 uniapp/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue | 275 ++++ uniapp/pages/active/tmsearch.vue | 4 uniapp/pages/index/index.vue | 26 uniapp/pages/login/setInviteCode.vue | 26 uniapp/static/images/tabBar/compareprice_activity.png | 0 uniapp/pages/rankinglist/common_act.vue | 28 63 files changed, 3,540 insertions(+), 140 deletions(-) diff --git a/uniapp/App.vue b/uniapp/App.vue index 0838844..adf7563 100644 --- a/uniapp/App.vue +++ b/uniapp/App.vue @@ -11,11 +11,14 @@ // #endif export default { onLaunch: function() { + // #ifdef APP-PLUS //鎺ㄩ�佸紑濮� /* var info = plus.push.getClientInfo() + console.log(info); // 鑾峰彇褰撳墠璁惧鐨勫鎴风id,浼犵粰鍚庡彴,瀹炵幇鎸囧畾鐢ㄦ埛 - info && uni.setStorageSync('clientInfo', info) + info && uni.setStorageSync('clientInfo', info) */ + this.getPushCid(); // 浣跨敤5+App鐨勬柟寮忚繘琛岀洃鍚秷鎭帹閫� //娑堟伅鐐瑰嚮浜嬩欢 //銆怉PP鍦ㄧ嚎銆戯紝鏀跺埌閫忎紶娑堟伅閫氳繃锛屼笉浼氭彁閱掕嚦閫氱煡鏍忕洰锛岄渶瑕佸彂閫佹湰鍦版秷鎭紝鍐嶈繘琛岀偣鍑昏Е鍙戠殑鐐瑰嚮浜嬩欢銆� @@ -56,6 +59,7 @@ //鏀跺埌閫忎紶娑堟伅 //鍙湁APP鍦ㄧ嚎鏃讹紝鎵嶄細瑙﹀彂receive浜嬩欢锛岄�忎紶娑堟伅涓嶄細瑙﹀彂绯荤粺娑堟伅,闇�瑕佸垱寤烘湰鍦版秷鎭� plus.push.addEventListener("receive", function(msg) { + console.log('receive', JSON.stringify(msg)) //涓氬姟浠g爜 // IOS if (uni.getSystemInfoSync().platform == 'ios') { @@ -64,7 +68,8 @@ if (msg.type == "receive") { //鍒涘缓鏈湴娑堟伅,鍙戦�佺殑鏈湴娑堟伅涔熶細琚玶eceive鏂规硶鎺ユ敹鍒帮紝浣嗘病鏈塼ype灞炴�э紝涓攁ps鏄痭ull plus.push.createMessage(msg.content, JSON.stringify(msg), { - title: messageTitle + title: messageTitle, + //icon:'/static/images/app/pushlogo.png' }); } } else { // Android @@ -79,7 +84,7 @@ //娑堟伅鎺ㄩ�佺粨鏉� plus.push.addEventListener('click', res => { console.log(res); - }); */ + }); APPUpdate(); // #endif this.getAppInfo(); @@ -152,7 +157,6 @@ content: '妫�娴嬪埌缃戠粶鏉冮檺鍙兘璁剧疆涓哄叧闂紝鎮ㄥ彲浠ュ湪鈥滆缃�濅腑妫�鏌ユ棤绾挎暟鎹強铚傜獫绉诲姩缃戠粶' }) }else{ - console.log("鏄惁璇锋眰杩囷細"+that.globalData.hasinit) if(!that.globalData.hasinit) { that.getAppInfo(); @@ -175,7 +179,7 @@ var route = routes[routes.length - 1].route } // #ifdef APP-PLUS - if (this.globalData.canlisten && route != 'pages/mine/tools/turnChain') { + if (this.globalData.canlisten && route != 'pages/mine/tools/turnChain'&&route!='pages/rankinglist/compareprice') { getClipboard() } @@ -187,11 +191,9 @@ bcInit:function() { var that = this; - console.log(uni.getSystemInfoSync().platform); if (uni.getSystemInfoSync().platform == 'ios') { const plug = uni.requireNativePlugin('xiguazhu-baichuan'); - console.log(plug) plug.init({}, result => { //console.log('1111111111111111111'); console.log(result); // code绛変簬0灏辨槸鍒濆鍖栨垚鍔� @@ -204,6 +206,40 @@ else{ that.globalData.hasbcinit=true; } + }, + getPushCid:function() + { + // #ifdef APP-PLUS + var info = plus.push.getClientInfo() + if(info&&info.clientid!='null') + {// 鑾峰彇褰撳墠璁惧鐨勫鎴风id,浼犵粰鍚庡彴,瀹炵幇鎸囧畾鐢ㄦ埛 + uni.setStorageSync('clientInfo', info); + this.updatePushCid(); + } + else{ + console.log('娌℃湁鑾峰彇鍒�'); + setTimeout(() => { + this.getPushCid(); + }, 1000) + } + // #endif + }, + updatePushCid:function() + { + let clientInfo = uni.getStorageSync('clientInfo'); + if(clientInfo&&clientInfo!='null'&&clientInfo.clientid) + { + console.log('寮�濮嬫洿鏂�'); + this.$u.api.updateCid({ + pushcid:clientInfo.clientid + }).then(e => { + }).catch(function (err) { + }) + } + else{ + this.getPushCid(); + } + }, getAppInfo: function() { var that = this; @@ -236,7 +272,6 @@ if (plus.runtime.isApplicationExist({pname:'com.tencent.mm', action: 'weixin://' })) { - console.log("瀹夊崜绔凡瀹夎寰俊") that.globalData.ifwt = 1 //鏄惁瀹夎寰俊 1浠h〃瀹夎 } else { console.log("瀹夊崜绔湭瀹夎寰俊") diff --git a/uniapp/components/indexPage.vue b/uniapp/components/indexPage.vue index 02c7e68..b508431 100644 --- a/uniapp/components/indexPage.vue +++ b/uniapp/components/indexPage.vue @@ -392,6 +392,7 @@ v-if="bottomGoodsList.length>0"> <block v-for="(items,index) in bottomGoodsList" :key="index"> <view class="goods-items" @click="goDetails(items)"> + <!-- <colGoodsImg v-if="index==0&&itembannerList&&itembannerList.length>0" :popBannerSList="itembannerList"></colGoodsImg> --> <colGoods :items="items"></colGoods> </view> </block> @@ -411,6 +412,7 @@ import slideTop from './slideTop.vue' import colGoods from './colGoods.vue' import empowerModel from './empowerModel.vue' + import colGoodsImg from '@/components/colGoodsImg.vue' export default { props: { recomendType: { @@ -432,10 +434,12 @@ components: { slideTop, colGoods, - empowerModel + empowerModel, + colGoodsImg }, data() { return { + popBannerSList:[], fallingList: [], pageHeight: '', headerColor: '', @@ -491,9 +495,16 @@ swpidx: 0, canrefresh: true, fastenter:[], - popBannerSList:[], + itembannerList:[], enterTop:[], - enterDown:[] + enterDown:[], + tbbanner:[], + jdbanner:[], + dybanner:[], + pddbanner:[], + wphbanner:[], + haspreference:false, + preferData:{}, } }, watch: { @@ -521,14 +532,16 @@ }, created() { this._freshing = false; - this.changeRecommend(); + //this.changeRecommend(); + this.checkPreferenceGoods(); uni.$emit('initpage') this.getBannerInfo(); this.getHomeMenuList(); this.getrecommendGoods(); - this.getbottomGoodsList(this.bottomType); + //this.getbottomGoodsList(this.bottomType); this.getGOODSfalling(); this.getRQList(); + //this.getPageImg(); }, mounted() { this.$emit('scrolltoTop') @@ -538,6 +551,56 @@ }, 1500) }, methods: { + checkPreferenceGoods() + {//鏄惁鏈夋帹鑽� + var that = this; + var tmp_1 = { + mainTitle: '澶╃尗', + subTitle: '澶╃尗鐑攢', + type: 5 + }; + var tmp_2 = { + mainTitle: '澶╃尗', + subTitle: '涓轰綘鎺ㄨ崘', + type: 1 + }; + var tmp_3= { + mainTitle: '鎺ㄨ崘', + subTitle: '鐚滀綘鍠滄', + type: 7 + }; + var open_like_recommend = uni.getStorageSync('open_like_recommend'); + if(this.typedataList.length == 5)this.typedataList.shift() + if(open_like_recommend == 1){ + this.typedataList.unshift(tmp_2); + this.bottomType = tmp_2.type; + }else{ + this.typedataList.unshift(tmp_1); + this.bottomType = tmp_1.type; + } + this.$u.api.checkPreferenceGoods({ + }).then(e => { + console.log(e); + if(e.code != 0) + { + that.currentPage = 1; + that.getbottomGoodsList(that.bottomType); + return; + }; + if(e.data&&e.data.p_cids) + {//鏈夊亸濂� + that.preferData=e.data; + that.typedataList.unshift(tmp_3); + that.bottomType = tmp_3.type; + //鍘婚櫎鍞搧浼� + that.typedataList = that.typedataList.filter(function(item) {return item.type !== 4}); + } + that.currentPage = 1; + that.getbottomGoodsList(that.bottomType); + }).catch(function (err) { + this.changeRecommend(); + }) + }, changeRecommend(){ var tmp_1 = { mainTitle: '澶╃尗', @@ -545,7 +608,7 @@ type: 5 }; var tmp_2 = { - mainTitle: '鎺ㄨ崘', + mainTitle: '澶╃尗', subTitle: '涓轰綘鎺ㄨ崘', type: 1 }; @@ -595,7 +658,6 @@ }, onRestore() { this.swpidx = 0 - console.log('涓嬫媺琚粓姝�'); }, pagescroll(e) { this.$emit('scrollNum', e.detail.scrollTop) @@ -688,42 +750,81 @@ that.dyList = e.data.dygoods; }).catch(function(err) {}) }, - + getPageImg() + { + var that=this; + this.$u.api.getBanner({ + type: '11,16,17,18,19,20' + }).then(e => { + if (e.code == 1) return that.$alert(e.msg); + var res = e.data.info; + that.tbbanner=res.tmImg; + that.jdbanner=res.jdImg; + that.dybanner=res.dyImg; + that.pddbanner=res.pddImg; + that.wphbanner=res.wphImg; + that.changeBanner(that.bottomCurrent); + }).catch(function(err) { + console.log(err) + }) + }, + changeBanner(type) + { + switch(type) + { + case 2://浜笢 + this.itembannerList=this.jdbanner; + break; + case 6://鎶栭煶 + this.itembannerList=this.dybanner; + break; + case 3://鎷煎澶� + this.itembannerList=this.pddbanner; + break; + case 4://鍞搧浼� + this.itembannerList=this.wphbanner; + break; + default: + this.itembannerList=[]; + break; + } + if(this.itembannerList&&this.itembannerList>0) + { + that.bottomGoodsList.unshift(this.itembannerList[0]); + } + }, getbottomGoodsList(type) { var that = this; - this.$u.api.getGoodThing({ - deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < 10 ? - 'IMEI' : 'OAID') : 'IDFA', - deviceValue: getApp().globalData.equipmentNumber, - pageId: 1, - pageSize: 10, - type: type - }).then(e => { - if (e.code != 0) return that.$alert(e.msg) - var res = e.data.list; - if (res.length < 10) { - that.loadingState = false - that.loadstatus = 'normal' - } else { - that.currentPage++ - that.loadstatus = 'loading' - that.loadingState = true - } - that.bottomGoodsList = res - }).catch(function(err) {}) - }, - - getNextPage() { - if (this.loadingState) { - this.loadingState = false - var that = this; + if(type==7&&that.preferData) + {//鐚滀綘鍠滄 + this.$u.api.gussessLikeGoods({ + platefrom:that.preferData.p_platefrom, + cids:that.preferData.p_cids, + pageId:1, + pageSize:10 + }).then(e=>{ + console.log(e); + var res = e.data.list; + if (res.length < 10) { + that.loadingState = false + that.loadstatus = 'normal' + } else { + that.currentPage++ + that.loadstatus = 'loading' + that.loadingState = true + } + that.bottomGoodsList = res + }) + } + else + { this.$u.api.getGoodThing({ - deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < - 10 ? 'IMEI' : 'OAID') : 'IDFA', + deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < 10 ? + 'IMEI' : 'OAID') : 'IDFA', deviceValue: getApp().globalData.equipmentNumber, - pageId: this.currentPage, + pageId: 1, pageSize: 10, - type: this.bottomType + type: type }).then(e => { if (e.code != 0) return that.$alert(e.msg) var res = e.data.list; @@ -735,8 +836,60 @@ that.loadstatus = 'loading' that.loadingState = true } - that.bottomGoodsList = that.bottomGoodsList.concat(res) + that.bottomGoodsList = res }).catch(function(err) {}) + } + }, + + getNextPage() { + if (this.loadingState) { + this.loadingState = false + var that = this; + + if(that.bottomType==7&&that.preferData) + {//鐚滀綘鍠滄 + this.$u.api.gussessLikeGoods({ + platefrom:that.preferData.p_platefrom, + cids:that.preferData.p_cids, + pageId:this.currentPage, + pageSize:10 + }).then(e=>{ + console.log(e); + if (e.code != 0) return that.$alert(e.msg) + var res = e.data.list; + if (res.length < 10) { + that.loadingState = false + that.loadstatus = 'normal' + } else { + that.currentPage++ + that.loadstatus = 'loading' + that.loadingState = true + } + that.bottomGoodsList = that.bottomGoodsList.concat(res); + }) + } + else{ + this.$u.api.getGoodThing({ + deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < + 10 ? 'IMEI' : 'OAID') : 'IDFA', + deviceValue: getApp().globalData.equipmentNumber, + pageId: this.currentPage, + pageSize: 10, + type: this.bottomType + }).then(e => { + if (e.code != 0) return that.$alert(e.msg) + var res = e.data.list; + if (res.length < 10) { + that.loadingState = false + that.loadstatus = 'normal' + } else { + that.currentPage++ + that.loadstatus = 'loading' + that.loadingState = true + } + that.bottomGoodsList = that.bottomGoodsList.concat(res) + }).catch(function(err) {}) + } } }, @@ -744,6 +897,7 @@ if (this.bottomCurrent != idx) { this.currentPage = 1; this.bottomType = info.type; + this.changeBanner(info.type); this.getbottomGoodsList(this.bottomType); this.$nextTick(() => { this.$emit('scrolltoview') diff --git a/uniapp/components/pddremind.vue b/uniapp/components/pddremind.vue index 3cb6cbc..4a58b34 100644 --- a/uniapp/components/pddremind.vue +++ b/uniapp/components/pddremind.vue @@ -8,7 +8,7 @@ </view> <view class="tips-container colCen"> <view class="grey-txt"> - 璇ュ晢鍝佸彲鑳芥秹鍙婃瘮浠凤紝鑷喘鍙兘浼氭棤浣i噾 + 璇ュ晢鍝佸彲鑳芥秹鍙婃瘮浠凤紝鑷喘鍙兘浼氭棤浣i噾锛屽缓璁偍鍏堟敹钘忚鍟嗗搧锛�2涓皬鏃跺�欏啀杩涘ぇ杩斿畼app璐拱 </view> <view class="pink-txt"> 姣斾环瀹氫箟锛氭偍鍦ㄦ嫾澶氬APP/缃戠珯璁块棶浜嗚鍟嗗搧鐨勮鎯咃紝鍐嶉�氳繃鏈珹PP杩涜杞摼鑷喘鐨勮涓� @@ -40,10 +40,10 @@ <style lang="scss"> .pddremind-container { width: 600rpx; - height: 630rpx; + height: 690rpx; background: #FFFFFF; border-radius: 10rpx; - padding: 0 45rpx; + padding: 0 25rpx; position: relative; .topbac { @@ -87,6 +87,7 @@ .pink-txt { color: #FD002F; + margin-top: 20rpx; } } diff --git a/uniapp/manifest.json b/uniapp/manifest.json index d97a230..29c8a25 100644 --- a/uniapp/manifest.json +++ b/uniapp/manifest.json @@ -2,8 +2,8 @@ "name" : "澶ц繑瀹�", "appid" : "__UNI__FC8858A", "description" : "澶ц繑瀹榓pp", - "versionName" : "1.1.3", - "versionCode" : 113, + "versionName" : "1.2.5", + "versionCode" : 125, "transformPx" : false, /* 5+App鐗规湁鐩稿叧 */ "app-plus" : { @@ -115,7 +115,18 @@ } }, "push" : { - "unipush" : {} + "unipush" : { + "icons" : { + "small" : { + // 宸︿笂瑙掑皬鍥炬爣 + "ldpi" : "unpackage/res/drawable-ldpi/push_small.png", + "mdpi" : "unpackage/res/drawable-mdpi/push_small.png", + "hdpi" : "unpackage/res/drawable-hdpi/push_small.png", + "xhdpi" : "unpackage/res/drawable-xhdpi/push_small.png", + "xxhdpi" : "unpackage/res/drawable-xxhdpi/push_small.png" + } + } + } }, "geolocation" : { "amap" : { diff --git a/uniapp/pages.json b/uniapp/pages.json index 9fa9c12..0b182d2 100644 --- a/uniapp/pages.json +++ b/uniapp/pages.json @@ -464,6 +464,16 @@ } } }, + // 姣斾环 + { + "path": "pages/rankinglist/compareprice", + "style": { + "navigationStyle": "custom", + "app-plus": { + "titleNView": false + } + } + }, // 绾挎姤 { "path": "pages/rankinglist/xianbao", @@ -477,6 +487,16 @@ //鍏叡宓屽椤甸潰 { "path": "pages/rankinglist/common_act", + "style": { + "navigationStyle": "custom", + "app-plus": { + "titleNView": false + } + } + }, + //鍏叡涓浆椤� + { + "path": "pages/rankinglist/common_transfer", "style": { "navigationStyle": "custom", "app-plus": { @@ -894,17 +914,23 @@ "text": "鐤姠姒�" }, { + "pagePath": "pages/rankinglist/compareprice", + "iconPath": "static/images/tabBar/compareprice.png", + "selectedIconPath": "static/images/tabBar/compareprice_activity.png", + "text": "鎼滀綆浠�" + }, + { "pagePath": "pages/rankinglist/xianbao", "iconPath": "static/images/tabBar/ne_xb.png", "selectedIconPath": "static/images/tabBar/ne_xb_act.png", "text": "绾挎姤" }, - { + /* { "pagePath": "pages/community/community", "iconPath": "static/images/tabBar/ne_bend.png", "selectedIconPath": "static/images/tabBar/ne_bend_act.png", "text": "鏈湴鐢熸椿" - }, + }, */ { "pagePath": "pages/mine/mine", diff --git a/uniapp/pages/active/specialOffer.vue b/uniapp/pages/active/specialOffer.vue index 0774dc8..55eb7e7 100644 --- a/uniapp/pages/active/specialOffer.vue +++ b/uniapp/pages/active/specialOffer.vue @@ -27,8 +27,14 @@ </view> </view> </view> - - <view class="rangeList-container rowCen"> + <view style="width: 100%;z-index: 999;"> + <view class="platvie"> + <view @click="changePlat(items.id)" class="platvie-plat" :class="currentplat==items.id?'platvie-active':''" v-for="(items,index) in platList" :key="index"> + {{items.text}} + </view> + </view> + </view> + <view class="rangeList-container rowCen" v-if="currentplat=='tb'"> <block v-for="(items,index) in priceRangelist" :key="index"> <view class="rangeItem colCen" :class="nowCurrent==items.type?'rangeItem-active':''" @tap="changeRange(items.type)"> <view class="nameBox"> @@ -61,7 +67,18 @@ }, data() { return { + currentplat:'tb', nowCurrent: -1, + platList:[ + { + id:'tb', + text:'娣樺疂' + }, + { + id:'jd', + text:'浜笢' + } + ], priceRangelist: [{ txt: '鎺ㄨ崘', type: -1 @@ -91,10 +108,19 @@ }, onReachBottom() { if (this.canloadmore) { + this.getData() } }, methods: { + changePlat(plat) + { + this.currentplat=plat; + this.pageCurrent = 1 + this.goodsList = [] + this.canloadmore = false + this.getData(); + }, changeRange(type) { this.pageCurrent = 1 this.canloadmore = false @@ -106,8 +132,10 @@ this.$u.api.getPineGoods( { nineCid: this.nowCurrent, page: this.pageCurrent, + plat:this.currentplat, pageSize: 20 }).then(e => { + console.log(e); if(e.code == 1)return that.$alert(e.msg); var res = e.data.list; uni.stopPullDownRefresh(); @@ -128,7 +156,6 @@ }) }, goDetail(info) { - console.log(info); uni.navigateTo({ url: '../goods/goodsDetail?info=' + encodeURIComponent(JSON.stringify(info)) }) @@ -149,6 +176,28 @@ </script> <style lang="scss"> + .platvie + { + width: 55%; + height: 100rpx; + z-index: 999; + display: flex; + text-align: center; + justify-content: center; + align-items: center; + margin: 0 auto; + } + .platvie-plat + { + width:33%; + font-size: 17px; + color: #dbd5d5; + } + .platvie-active + { + font-size: 19px; + color:#fff; + } .specialOffer-wrapper { width: 100%; min-height: 380rpx; @@ -266,7 +315,7 @@ z-index: 1; width: 100%; padding: 0 32rpx; - margin-top: 210rpx; + margin-top: 310rpx; .goods-content { width: 100%; diff --git a/uniapp/pages/active/tmsearch.vue b/uniapp/pages/active/tmsearch.vue index 5dc18e4..c6445a1 100644 --- a/uniapp/pages/active/tmsearch.vue +++ b/uniapp/pages/active/tmsearch.vue @@ -62,7 +62,7 @@ </scroll-view> </view> <!--浜岀骇鎼滅储--> - <view class="scrangeList-container rowCen" :class="scrollTop>fiexdtop?'tofixed':''" :style="'top:'+(scrollTop>fiexdtop?fiexdHeight:'0')+'px;'"> + <view class="scrangeList-container rowCen" :class="scrollTop>fiexdtop?'tofixed':''" > <scroll-view class="scrollview-content" scroll-x scroll-with-animation="true"> <block v-for="(items,index) in secrendSearch" :key="index"> <view class="rangeItem" style="font-size: 13px;margin-right: 30rpx; color: #8b8686;" :class="nowsec==items.id?'rangeItem-active':''" @tap="changeSeRange(items.id)"> @@ -390,7 +390,7 @@ .scrangeList-container { width: 100%; - height: 80rpx; + height: 40rpx; padding-left: 32rpx; z-index: 101; diff --git a/uniapp/pages/goods/goodsDetail.vue b/uniapp/pages/goods/goodsDetail.vue index 90c03aa..48d87d0 100644 --- a/uniapp/pages/goods/goodsDetail.vue +++ b/uniapp/pages/goods/goodsDetail.vue @@ -212,6 +212,8 @@ </view> </view> </view> + + <!-- <view class="right-container rowCen borderBox" v-if="!showtar || platform!='iOS'"> <view class="leftsharebox btnbox colCenCen" @tap="goPath()"> @@ -276,6 +278,12 @@ <u-popup v-model="inviterShow" mode="center" border-radius="32" v-if="inviterShow" :mask-close-able='true'> <inviter-model ref='invitermodel' @rewrite='rewriteCode' @setInvite='setCodebtn'></inviter-model> </u-popup> + <uni-popup ref="popup_pddtip" type="center"> + <view class="pdd_pop_contant"> + <view class="pdd_pop_title">姣斾环璁㈠崟</view> + <view class="pdd_pop_text">鏈鑷喘娑夊強姣斾环琛屼负锛岃嚜璐敹鐩婁负0锛屽缓璁厛鏀惰棌璇ュ晢鍝侊紝2灏忔椂鍚庨�氳繃澶ц繑瀹榓pp璐拱锛屽彲姝e父鑾峰彇瀵瑰簲鏀剁泭銆�</view> + </view> + </uni-popup> </view> </template> @@ -321,6 +329,8 @@ inviteCodeShow: false, inviterShow: false, frompage:'', + isshowpdd:false, + beforePddAuth:false, }; }, onPageScroll(e) { @@ -340,6 +350,12 @@ getApp().bcInit(); } }, + onReady(){ + if(this.isshowpdd) + { + this.$refs.popup_pddtip.open(); + } + }, onLoad(options) { this.appinfo = utils.getCacheSync('appInfo') // #ifdef APP-PLUS @@ -358,6 +374,7 @@ console.log(options); if(options.sourcefrom) { + console.log(decodeURIComponent(options.info)); this.optionsInfo = JSON.parse(decodeURIComponent(options.info)); this.pageInfo = JSON.parse(decodeURIComponent(options.info)); console.log(this.optionsInfo) @@ -367,12 +384,15 @@ this.optionsInfo = JSON.parse(options.info); this.pageInfo = JSON.parse(options.info); } - this.pageType = this.optionsInfo.sourceType; if (!this.optionsInfo.faction) { if (this.pageType == 'tb' || this.pageType == 'tm' || this.pageType == 'tmshop') this.faction = 't'; if (this.pageType == 'jd') this.faction = 'j'; - if (this.pageType == 'pdd') this.faction = 'p'; + if (this.pageType == 'pdd') + { + this.faction = 'p'; + + } if (this.pageType == 'wph') this.faction = 'w'; if (this.pageType == 'dy') this.faction = 'd'; } else { @@ -387,6 +407,12 @@ } else { this.memberId = '' } + console.log(this.user); + if(this.user.pdd_authority_ios==1||this.user.pdd_authority_android==1) + { + this.beforePddAuth=true; + } + console.log(this.beforePddAuth); } catch (e) { this.memberId = '' } @@ -400,6 +426,10 @@ this.pageInfo.showImgs.push(a) this.getrecommend() } else if (this.pageType == 'pdd') { + /* if(this.optionsInfo.predictPromotionRate==0) + {//姣斾环璁㈠崟 + this.remindModel=true; + } */ } else if (this.pageType == 'jd') { @@ -416,18 +446,19 @@ this.empowerModel = false this.pddempowerModel = false }, + closeremind() + { + this.remindModel=false; + }, getPageInfo(e) { var that = this; + console.log(this.faction) if (this.faction == 'j') { - var loinf={ - goodsId: this.optionsInfo.goodsId, - goods: JSON.stringify(this.optionsInfo) - } - console.log(loinf) this.$u.api.getJdsDetail({ goodsId: this.optionsInfo.goodsId, goods: JSON.stringify(this.optionsInfo) }).then(e => { + console.log(e) var res = e.data.detailPics; this.JdDetails = that.JdDetails.concat(res) that.$forceUpdate() @@ -449,14 +480,7 @@ this.optionsInfo = res }).catch(function(err) {}) } else if (this.faction == 'p') { - var that = this; - this.$u.api.getPddDetail({ - goods_sign: this.optionsInfo.goods_sign - }).then(e => { - var res = e.data; - that.pageInfo = res; - that.optionsInfo.imgs = that.pageInfo.imgs; - }) + this.getPddGoodsDetail(this.optionsInfo.goods_sign); } else if (this.faction == 'w') { var that = this; this.$u.api.getWphGoodsDetail({ @@ -485,17 +509,28 @@ }) } }, - - + getPddGoodsDetail(goods_sign) + { + var that = this; + this.$u.api.getPddDetail({ + goods_sign: goods_sign + }).then(e => { + var res = e.data; + that.pageInfo = res; + console.log(res); + that.optionsInfo.imgs = that.pageInfo.imgs; + if(res.predictPromotionRate==0) + {//姣斾环璁㈠崟 + this.remindModel=true; + } + }) + }, goDetails(info) { info.searchSource = 1 uni.navigateTo({ url: './goodsDetail?info=' + encodeURIComponent(JSON.stringify(info)) }) }, - - - getrecommend() { var that = this; this.$u.api.getSimilerGoods({ @@ -556,7 +591,6 @@ console.log(this.pageType) if (this.pageType == 'tb' || this.pageType == 'tmshop' || this.pageType == 'tm') { if (this.user.tb_account) { - this.getTbsrc() } else { this.empowerModel = true @@ -596,8 +630,14 @@ updataUser() { var that = this; this.$u.api.getUserInfo({}).then(e => { + console.log(e) utils.setCache('userInfo', e.data.userinfo) that.user = e.data.userinfo; + if(that.pageType == 'pdd'&&!that.beforePddAuth&&(e.data.userinfo.pdd_authority_ios == 1||e.data.userinfo.pdd_authority_android == 1)) + {//閲嶆柊鏌ヨ鍟嗗搧璇︽儏 + console.log('閲嶆柊鏌ヨpdd鍟嗗搧'); + that.getPddGoodsDetail(that.optionsInfo.goods_sign);0 + } }).catch(function(err) {}) }, @@ -610,10 +650,11 @@ if (e.code != 0) return that.$alert(e.msg) if(that.frompage=='freebuy') {//0鍏冭喘鐨勮褰曞晢鍝乮d - console.log(e.data.info.itemId); + console.log(e.data.info.itemId); this.$u.api.updateFirstFreeBrowse({ goodsid:that.optionsInfo.goodsId, - new_goodsId:e.data.info.itemId + new_goodsId:e.data.info.itemId, + plateform:'tb' }).then(e=>{ }); @@ -675,7 +716,20 @@ }, getJDsrc() { - var that = this; + var that = this; + console.log(this.frompage); + console.log(that.optionsInfo.goodsId); + if(this.frompage=='freebuy') + {//0鍏冭喘鐨勮褰曞晢鍝乮d + this.$u.api.updateFirstFreeBrowse({ + goodsid:that.optionsInfo.goodsId, + new_goodsId:that.optionsInfo.goodsId, + plateform:'jd' + }).then(e=>{ + + }); + } + this.$u.api.getPrivilegeLink({ goodsId: this.optionsInfo.goodsId, type: 1 @@ -735,6 +789,16 @@ }).then(e => { var res = e.data.info; console.log(res) + if(that.frompage=='freebuy') + {//0鍏冭喘鐨勮褰曞晢鍝乮d + this.$u.api.updateFirstFreeBrowse({ + goodsid:that.optionsInfo.goodsId, + new_goodsId:that.optionsInfo.goodsId, + plateform:'dy' + }).then(e=>{ + + }); + } // #ifdef APP-PLUS plus.runtime.openURL(res.dy_deeplink, e => { uni.navigateTo({ @@ -848,6 +912,24 @@ } </style> <style lang="scss" scoped> + .pdd_pop_contant{ + background-color: rgb(255, 255, 255); + padding: 40rpx; + width: 80%; + margin:0 auto; + border-radius: 20rpx; + .pdd_pop_title + { + text-align: center; + margin-bottom: 30rpx; + font-size: 18px; + } + .pdd_pop_text + { + margin-bottom: 30rpx; + color: #868080; + } + } .container { .flexbox { position: fixed; diff --git a/uniapp/pages/index/index.vue b/uniapp/pages/index/index.vue index 8b90c02..5104307 100644 --- a/uniapp/pages/index/index.vue +++ b/uniapp/pages/index/index.vue @@ -128,13 +128,13 @@ nowcurrentid:'', recomendType:1, isshowtype:false, - hasshow:false, + hasshow:false } }, onLoad() { - this.getCategoryList(); this.getPopBannerInfo(); + }, onShow() { if(!this.hasshow) @@ -150,11 +150,11 @@ this.recomendType = open_like_recommend == "" ? 1 : open_like_recommend; }, onReady() { - console.log("鑾峰彇楂樹綆") - this.getTopheight() + this.getTopheight(); }, watch: {}, methods: { + shShow() { var that=this; @@ -173,9 +173,12 @@ if(istoLogin) { if(!that.hasLogin){ - uni.reLaunch({ - url:"/pages/login/wxlogin" - }) + setTimeout(() => { + uni.reLaunch({ + url:"/pages/login/wxlogin" + }) + }, 1000) + } /* var user= uni.getStorageSync('userInfo'); if(!user.invitation_code) @@ -341,7 +344,6 @@ getTopheight() { // 鑾峰彇椤堕儴楂樺害 uni.createSelectorQuery().in(this).select('.fixed-container').boundingClientRect(data => { - console.log(data.height+":----------------"); this.Topheight = data.height }).exec(); }, @@ -367,6 +369,11 @@ </script> <style lang="scss"> + uni-image + { + width:30rem; + height:25rem + } .index-wrapper { height: 100vh; overflow: hidden; @@ -583,9 +590,10 @@ // height: 100vw; } } + .clone { position:absolute; - bottom: -150rpx; + bottom: -30rpx; transform: translate(calc(50% - 32rpx)); .image { width: 64rpx; diff --git a/uniapp/pages/index/launchPage.vue b/uniapp/pages/index/launchPage.vue index 546a7e6..5458bb5 100644 --- a/uniapp/pages/index/launchPage.vue +++ b/uniapp/pages/index/launchPage.vue @@ -29,8 +29,6 @@ this.$u.api.getBanner({ type: '1,15' }).then(e => { - - console.log(e) if (e.code == 1) {//杩斿洖澶辫触锛岀洿鎺ヨ烦棣栭〉 this.t_index(); @@ -42,7 +40,6 @@ that.list=res.launchpic; } else{ - console.log("璺宠浆") this.t_index(); } }).catch(function(err) { diff --git a/uniapp/pages/login/bindingPhone.vue b/uniapp/pages/login/bindingPhone.vue index 481813d..a9f421f 100644 --- a/uniapp/pages/login/bindingPhone.vue +++ b/uniapp/pages/login/bindingPhone.vue @@ -214,14 +214,19 @@ }, bindMobile(){ var that = this; - console.log(this.hasLogin) - console.log(this.wxUser) + let clientInfo = uni.getStorageSync('clientInfo'); + var pushCid=""; + if(clientInfo&&clientInfo.clientid) + { + pushCid=clientInfo.clientid; + } if(this.wxUser != ""){ this.$u.api.bindMobileLogin({ wxUser : encodeURIComponent(JSON.stringify(that.wxUser)), mobile:this.phone, captcha:this.code, - isyj:this.isyj + isyj:this.isyj, + pushCid:pushCid }).then(e => { console.log(e) if (e.code != 0) return that.$alert(e.msg) diff --git a/uniapp/pages/login/login.vue b/uniapp/pages/login/login.vue index 081fffd..c3e3ee0 100644 --- a/uniapp/pages/login/login.vue +++ b/uniapp/pages/login/login.vue @@ -40,9 +40,9 @@ </view> <view class="bottom-fixed colCen"> - <view class="verification-Code" @click="changeWay()"> + <!-- <view class="verification-Code" @click="changeWay()"> {{ifPasslogin?'楠岃瘉鐮�':'瀵嗙爜'}}鐧诲綍 - </view> + </view> --> <view class="explain-text rowCen"> <switch type="checkbox" @change="changeread" :checked='isread' style="transform:scale(0.6)"/> 鐧婚檰浠h〃宸茶缁嗛槄璇诲苟鍚屾剰<text @click="goPage('agreement')">銆婄敤鎴峰崗璁��</text>鍜�<text @click="goPage('policy')">銆婇殣绉佹斂绛栥��</text> @@ -77,8 +77,7 @@ showPass: true, second: 60, canGetCode: true, - prevent: true, - clientid:"" + prevent: true }; }, onLoad() { @@ -96,12 +95,12 @@ }, dologin() { var that = this; - // #ifdef APP-PLUS - plus.push.getClientInfoAsync((info) => { - that.clientid = info["clientid"]; - }); - // #endif - + let clientInfo = uni.getStorageSync('clientInfo'); + var pushCid=""; + if(clientInfo&&clientInfo.clientid) + { + pushCid=clientInfo.clientid; + } if(this.isread){ if (this.ifPasslogin) { //瀵嗙爜鐧诲綍 @@ -123,11 +122,17 @@ }).catch(function (err) { }) } else { + let strsr={ + mobile: this.phone, + captcha: this.code, + pushCid:pushCid + }; + console.log(strsr) //楠岃瘉鐮佺櫥褰� this.$u.api.mobileLogin({ mobile: this.phone, captcha: this.code, - push_cid:this.clientid + pushCid:pushCid }).then(e => { that.login(e.data.userinfo); if(e.code != 0) return that.$alert(e.msg) @@ -216,6 +221,8 @@ url: './setPass' }) } */else { + //鏇存柊pushcid + getApp().updatePushCid(); uni.switchTab({ url: '../index/index' }) diff --git a/uniapp/pages/login/setInviteCode.vue b/uniapp/pages/login/setInviteCode.vue index 66e25db..efa0c41 100644 --- a/uniapp/pages/login/setInviteCode.vue +++ b/uniapp/pages/login/setInviteCode.vue @@ -168,6 +168,7 @@ }, setCode() { + console.log("纭畾"); var that=this; if(this.inviteCode) { @@ -177,11 +178,32 @@ console.log(e) if(e.code != 0) return that.$alert(e.msg) uni.setStorageSync('inviterInfo',e.data) - this.inviterShow = true + //this.inviterShow = true + this.setinvite(); }).catch(function (err) { }) } - } + }, + setinvite() { + var that = this; + let deviceInfo = uni.getDeviceInfo(); + console.log(deviceInfo.deviceId); + this.$u.api.bindInvitation({ + invite_code:this.inviteCode, + deviceid:deviceInfo.deviceId + }).then(e => { + if(e.code != 0) return that.$alert(e.msg) + uni.showToast({ + title:'缁戝畾鎴愬姛锛�', + icon:'none' + }) + setTimeout(function(){ + that.getuserInfo(); + },1000) + }).catch(function (err) { + }) + + }, } } </script> diff --git a/uniapp/pages/login/wxlogin.vue b/uniapp/pages/login/wxlogin.vue index 5a53652..092e5d0 100644 --- a/uniapp/pages/login/wxlogin.vue +++ b/uniapp/pages/login/wxlogin.vue @@ -113,12 +113,20 @@ }, doMobileLogin(mobRes) { + //浠庣紦瀛樿幏鍙朿id + let clientInfo = uni.getStorageSync('clientInfo'); + let pushCid=''; + if(clientInfo&&clientInfo.clientid) + { + pushCid=clientInfo.clientid + } var that=this; uniCloud.callFunction({ name: 'getPhoneNumber', // 浣犵殑浜戝嚱鏁板悕绉� data: { 'access_token': mobRes.access_token, // 瀹㈡埛绔竴閿櫥褰曟帴鍙h繑鍥炵殑access_token - 'openid': mobRes.openid // 瀹㈡埛绔竴閿櫥褰曟帴鍙h繑鍥炵殑openid + 'openid': mobRes.openid, // 瀹㈡埛绔竴閿櫥褰曟帴鍙h繑鍥炵殑openid + 'pushCid':pushCid//app鎺ㄩ�乧id } }).then(res => { console.log(res) @@ -207,6 +215,8 @@ url: './setPass' }) } */ else { + //鏇存柊pushcid + getApp().updatePushCid(); uni.switchTab({ url: '../index/index' }) diff --git a/uniapp/pages/mine/elm.vue b/uniapp/pages/mine/elm.vue index 80ff3e0..32811ef 100644 --- a/uniapp/pages/mine/elm.vue +++ b/uniapp/pages/mine/elm.vue @@ -272,7 +272,7 @@ .options-bar-content { width: 100%; - margin-top: 168rpx; + margin-top: 198rpx; .center-container { position: relative; diff --git a/uniapp/pages/mine/mt.vue b/uniapp/pages/mine/mt.vue index a8e5b9b..dc06dd6 100644 --- a/uniapp/pages/mine/mt.vue +++ b/uniapp/pages/mine/mt.vue @@ -129,6 +129,7 @@ this.$u.api.meituanAct({type:this.optionsCurrent}).then(e => { if(e.code != 0)return that.$alert(e.msg) uni.stopPullDownRefresh() + console.log(e) that.mtInfo = e.data.info; that.wxQrcodeUrl = that.mtInfo.we_app_info.miniCode; }).catch(function (err) { @@ -252,7 +253,7 @@ .options-bar-content { width: 100%; - margin-top: 168rpx; + margin-top: 198rpx; .center-container { position: relative; width: 240rpx; diff --git a/uniapp/pages/rankinglist/common_act.vue b/uniapp/pages/rankinglist/common_act.vue index e8f2b52..00ea3b0 100644 --- a/uniapp/pages/rankinglist/common_act.vue +++ b/uniapp/pages/rankinglist/common_act.vue @@ -56,16 +56,40 @@ console.log(res); switch(res.action) { - case "back": + case "back"://杩斿洖 this.backLast(); break; - case "tbauth": + case "tbauth"://娣樺疂鎺堟潈 this.openTbMd(); + break; + case "totb": + this.targetTb(res.tburl); break; } }, + targetTb(tburl) + { + // #ifdef APP-PLUS + if (plus.runtime.isApplicationExist({ + pname: 'com.taobao.taobao', + action: 'taobao://' + })) { + const plug = uni.requireNativePlugin('xiguazhu-baichuan') + plug.detailPage({ + url: tburl, + "openType": 0 + }, result => { + }); + } else { + uni.navigateTo({ + url:'@/webView/webView?url=' + tburl + }) + } + // #endif + }, backLast() { + console.log("杩斿洖") uni.navigateBack({ delta: 1 }); diff --git a/uniapp/pages/rankinglist/common_transfer.vue b/uniapp/pages/rankinglist/common_transfer.vue new file mode 100644 index 0000000..ae97aba --- /dev/null +++ b/uniapp/pages/rankinglist/common_transfer.vue @@ -0,0 +1,96 @@ +<template> + <view> + + <!-- taobao --> + <u-popup v-model="empowerModel" mode="center" border-radius="12"> + <empowerModel @closemodel='closeMdl' @updataInfo='updataUser'></empowerModel> + </u-popup> + </view> + +</template> + +<script> + import empowerModel from '../../components/empowerModel.vue' + var wv; + export default { + components: { + empowerModel + }, + data() { + return { + user:'', + webshow:true, + empowerModel: false, + } + }, + onLoad(options) { + console.log(options); + if(options.needlogin) + {//鏄惁闇�瑕佺櫥褰� + if(!this.hasLogin){ + uni.reLaunch({ + url:"/pages/login/wxlogin" + }) + } + } + switch(options.trantype) + { + case "totb": + this.targetTb(options.tburl); + break; + } + if(options.back) + { + uni.navigateBack({ + delta: 1 + }); + } + }, + onReady() { + + }, + + methods: { + targetTb(tburl) + { + // #ifdef APP-PLUS + if (plus.runtime.isApplicationExist({ + pname: 'com.taobao.taobao', + action: 'taobao://' + })) { + const plug = uni.requireNativePlugin('xiguazhu-baichuan') + plug.detailPage({ + url: tburl, + "openType": 0 + }, result => { + }); + } else { + uni.navigateTo({ + url:'@/webView/webView?url=' + tburl + }) + } + // #endif + }, + closeMdl() { + this.empowerModel = false; + this.webshow=true; + }, + openTbMd() + { + this.webshow=false; + this.empowerModel = true + }, + updataUser() { + var that = this; + this.$u.api.getUserInfo({}).then(e => { + utils.setCache('userInfo', e.data.userinfo) + that.user = e.data.userinfo; + }).catch(function(err) {}) + }, + }, + } +</script> + +<style> + +</style> diff --git a/uniapp/pages/rankinglist/compareprice.vue b/uniapp/pages/rankinglist/compareprice.vue new file mode 100644 index 0000000..bcd6277 --- /dev/null +++ b/uniapp/pages/rankinglist/compareprice.vue @@ -0,0 +1,163 @@ +<template> + <view> + <web-view v-if="webshow" :webview-styles="webviewStyles" :src="webviewUrl" @message='received'></web-view> + <!-- taobao --> + <u-popup v-model="empowerModel" mode="center" border-radius="12"> + <empowerModel @closemodel='closeMdl' @updataInfo='updataUser'></empowerModel> + </u-popup> + </view> + +</template> + +<script> + import empowerModel from '../../components/empowerModel.vue' + var wv; + export default { + components: { + empowerModel + }, + data() { + return { + webshow:true, + empowerModel: false, + webviewUrl: '', + user:'', + webviewStyles: { + progress: { + color: '#EE1B14' + } + }, + } + }, + onLoad(options) { + if(!this.hasLogin){ + uni.reLaunch({ + url:"/pages/login/wxlogin" + }) + } + else{ + const value = uni.getStorageSync('userInfo'); + console.log(value) + this.webviewUrl = encodeURI('http://dfgapp.ushopvip.com/html/compareprice.html?token='+value.token); + //this.webviewUrl = encodeURI('http://appapitest.ushopvip.com/html/compareprice.html?token='+value.token); + } + + }, + onReady() { + this.clearMuiBack(); + }, + methods: { + + received(e) { + var res=e.detail.data[0]; + console.log(res); + switch(res.action) + { + case "back"://杩斿洖 + this.backLast(); + break; + case "tbauth"://娣樺疂鎺堟潈 + this.openTbMd(); + break; + case "totb": + this.targetTb(res.tburl); + break; + case "copy": + this.getCopyTxt(); + break; + case "getlike": + this.getLike(); + break; + } + }, + getLike() + { + console.log('杩涙潵浜�'); + var postData={ + deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < 10 ? 'IMEI' : 'OAID') : + 'IDFA', + deviceValue: getApp().globalData.equipmentNumber + }; + console.log(postData); + var currentWebview = this.$scope.$getAppWebview().children()[0]; + currentWebview.evalJS(`likeDataGet(${JSON.stringify(postData)})`); + }, + getCopyTxt() + { + uni.getClipboardData({ + success: res => { + //璋冪敤椤甸潰閲岀殑鏂规硶 + console.log(res, '======================================================'); + var currentWebview = this.$scope.$getAppWebview().children()[0]; + currentWebview.evalJS(`scanCode(${JSON.stringify(res)})`); + } + }) + }, + targetTb(tburl) + { + // #ifdef APP-PLUS + if (plus.runtime.isApplicationExist({ + pname: 'com.taobao.taobao', + action: 'taobao://' + })) { + const plug = uni.requireNativePlugin('xiguazhu-baichuan') + plug.detailPage({ + url: tburl, + "openType": 0 + }, result => { + }); + } else { + uni.navigateTo({ + url:'@/webView/webView?url=' + tburl + }) + } + // #endif + }, + backLast() + { + console.log("杩斿洖") + uni.navigateBack({ + delta: 1 + }); + }, + closeMdl() { + this.empowerModel = false; + this.webshow=true; + }, + openTbMd() + { + this.webshow=false; + this.empowerModel = true + }, + updataUser() { + var that = this; + this.$u.api.getUserInfo({}).then(e => { + utils.setCache('userInfo', e.data.userinfo) + that.user = e.data.userinfo; + }).catch(function(err) {}) + }, + // 鍏抽棴mui杩斿洖 + clearMuiBack() { + // #ifdef APP-PLUS + /* var currentWebview = this.$scope.$getAppWebview().children()[0]; + //鐩戝惉娉ㄥ叆鐨刯s + currentWebview.addEventListener("loaded", function() { + currentWebview.evalJS("mui.init({keyEventBind: {backbutton: false }});"); + }); */ + // #endif + }, + + }, + onNavigationBarButtonTap(e) { + // #ifdef APP-PLUS + const currentWebview = this.$scope.$getAppWebview(); //姝ゅ璞$浉褰撲簬html5plus閲岀殑plus.webview.currentWebview()銆傚湪uni-app閲寁ue椤甸潰鐩存帴浣跨敤plus.webview.currentWebview()鏃犳晥锛岄潪v3缂栬瘧妯″紡浣跨敤this.$mp.page.$getAppWebview() + var wv = currentWebview.children()[0] + wv.reload(); + // #endif + }, + } +</script> + +<style> + +</style> diff --git a/uniapp/pages/rankinglist/fengqiang.vue b/uniapp/pages/rankinglist/fengqiang.vue index bfff77a..5a9ad31 100644 --- a/uniapp/pages/rankinglist/fengqiang.vue +++ b/uniapp/pages/rankinglist/fengqiang.vue @@ -48,6 +48,7 @@ else{ const value = uni.getStorageSync('userInfo'); console.log(value); + //this.webviewUrl = encodeURI('http://appapitest.ushopvip.com/html/fengqiangbang.html?token='+value.token); this.webviewUrl = encodeURI('http://dfgapp.ushopvip.com/html/fengqiangbang.html?token='+value.token); } @@ -57,15 +58,22 @@ }, methods: { received(e) { - console.log(e.detail.data[0].type) - if(e.detail.data[0].type=='getToken'){ - const token = uni.getStorageSync('userInfo').token; - var currentWebview = this.$scope.$getAppWebview() - var wv = currentWebview.children()[0] - wv.evalJS('localStorage.setItem("ZZTOKEN",' + JSON.stringify(token) + ')'); + var res=e.detail.data[0]; + console.log(res); + switch(res.action) + { + case "back"://杩斿洖 + this.backLast(); + break; } }, - + backLast() + { + console.log("杩斿洖") + uni.navigateBack({ + delta: 1 + }); + }, // 鍏抽棴mui杩斿洖 clearMuiBack() { // #ifdef APP-PLUS diff --git a/uniapp/pages/search/search.vue b/uniapp/pages/search/search.vue index 990c7ef..5221a4c 100644 --- a/uniapp/pages/search/search.vue +++ b/uniapp/pages/search/search.vue @@ -696,7 +696,7 @@ width: 60rpx; height: 24rpx; margin-right: 5rpx; - margin-top: 8rpx; + } .tradename { @@ -713,7 +713,7 @@ .price-saleNums-container { width: 100%; - margin-top: 30rpx; + margin-top: 10rpx; .left-price-box { .greytxt { diff --git a/uniapp/pages/search/searchResult.vue b/uniapp/pages/search/searchResult.vue index b9ad46e..e8157a7 100644 --- a/uniapp/pages/search/searchResult.vue +++ b/uniapp/pages/search/searchResult.vue @@ -371,7 +371,8 @@ sort: this.sortType, selectCoupon: this.selectCoupon == true ? 1 : 0 }).then(e => { - if (e.code != 0) return that.$alert(e.msg) + console.log(e); + if (e.code != 0) return; var res = e.data; uni.stopPullDownRefresh(); if (res.list.length < 10) { diff --git a/uniapp/static/images/app/pushlogo.png b/uniapp/static/images/app/pushlogo.png new file mode 100644 index 0000000..169c53f --- /dev/null +++ b/uniapp/static/images/app/pushlogo.png Binary files differ diff --git a/uniapp/static/images/tabBar/compareprice.png b/uniapp/static/images/tabBar/compareprice.png new file mode 100644 index 0000000..404fb5d --- /dev/null +++ b/uniapp/static/images/tabBar/compareprice.png Binary files differ diff --git a/uniapp/static/images/tabBar/compareprice_activity.png b/uniapp/static/images/tabBar/compareprice_activity.png new file mode 100644 index 0000000..e3f6505 --- /dev/null +++ b/uniapp/static/images/tabBar/compareprice_activity.png Binary files differ diff --git a/uniapp/uniCloud-aliyun/cloudfunctions/getPhoneNumber/index.js b/uniapp/uniCloud-aliyun/cloudfunctions/getPhoneNumber/index.js index 7750205..f5d4f2a 100644 --- a/uniapp/uniCloud-aliyun/cloudfunctions/getPhoneNumber/index.js +++ b/uniapp/uniCloud-aliyun/cloudfunctions/getPhoneNumber/index.js @@ -25,13 +25,19 @@ } else {//鎵嬫満鍙蜂竴閿櫥褰� + let pushCid=''; + if(event.pushCid) + { + pushCid=event.pushCid; + } var apiUrl='http://dfgapp.ushopvip.com/api/user/mobilelogin'; const apiRes = await uniCloud.httpclient.request(apiUrl, { method: 'POST', data: { - mobile: res.phoneNumber, + mobile: res.phoneNumber, captcha:'000', - ismobouth:true + ismobouth:true, + pushCid:pushCid }, contentType: 'json', // 鎸囧畾浠pplication/json鍙戦�乨ata鍐呯殑鏁版嵁 dataType: 'json' // 鎸囧畾杩斿洖鍊间负json鏍煎紡锛岃嚜鍔ㄨ繘琛宲arse diff --git a/uniapp/uni_modules/uni-popup/changelog.md b/uniapp/uni_modules/uni-popup/changelog.md new file mode 100644 index 0000000..bc59f07 --- /dev/null +++ b/uniapp/uni_modules/uni-popup/changelog.md @@ -0,0 +1,68 @@ +## 1.8.3锛�2023-04-17锛� +- 淇 uni-popup 閲嶅鎵撳紑鏃剁殑 bug +## 1.8.2锛�2023-02-02锛� +- uni-popup-dialog 缁勪欢鏂板 inputType 灞炴�� +## 1.8.1锛�2022-12-01锛� +- 淇 nvue 涓� v-show 鎶ラ敊 +## 1.8.0锛�2022-11-29锛� +- 浼樺寲 涓婚鏍峰紡 +## 1.7.9锛�2022-04-02锛� +- 淇 寮瑰嚭灞傚唴閮ㄦ棤娉曟粴鍔ㄧ殑bug +## 1.7.8锛�2022-03-28锛� +- 淇 灏忕▼搴忎腑楂樺害閿欒鐨刡ug +## 1.7.7锛�2022-03-17锛� +- 淇 蹇�熻皟鐢╫pen鍑虹幇闂鐨凚ug +## 1.7.6锛�2022-02-14锛� +- 淇 safeArea 灞炴�т笉鑳借缃负false鐨刡ug +## 1.7.5锛�2022-01-19锛� +- 淇 isMaskClick 澶辨晥鐨刡ug +## 1.7.4锛�2022-01-19锛� +- 鏂板 cancelText \ confirmText 灞炴�� 锛屽彲鑷畾涔夋枃鏈� +- 鏂板 maskBackgroundColor 灞炴�� 锛屽彲浠ヤ慨鏀硅挋鐗堥鑹� +- 浼樺寲 maskClick灞炴�� 鏇存柊涓� isMaskClick 锛岃В鍐冲井淇″皬绋嬪簭璀﹀憡鐨勯棶棰� +## 1.7.3锛�2022-01-13锛� +- 淇 璁剧疆 safeArea 灞炴�т笉鐢熸晥鐨刡ug +## 1.7.2锛�2021-11-26锛� +- 浼樺寲 缁勪欢绀轰緥 +## 1.7.1锛�2021-11-26锛� +- 淇 vuedoc 鏂囧瓧閿欒 +## 1.7.0锛�2021-11-19锛� +- 浼樺寲 缁勪欢UI锛屽苟鎻愪緵璁捐璧勬簮锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 鏂囨。杩佺Щ锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/uni-popup](https://uniapp.dcloud.io/component/uniui/uni-popup) +## 1.6.2锛�2021-08-24锛� +- 鏂板 鏀寔鍥介檯鍖� +## 1.6.1锛�2021-07-30锛� +- 浼樺寲 vue3涓嬩簨浠惰鍛婄殑闂 +## 1.6.0锛�2021-07-13锛� +- 缁勪欢鍏煎 vue3锛屽浣曞垱寤簐ue3椤圭洰锛岃瑙� [uni-app 椤圭洰鏀寔 vue3 浠嬬粛](https://ask.dcloud.net.cn/article/37834) +## 1.5.0锛�2021-06-23锛� +- 鏂板 mask-click 閬僵灞傜偣鍑讳簨浠� +## 1.4.5锛�2021-06-22锛� +- 淇 nvue 骞冲彴涓棿寮瑰嚭鍚庯紝鐐瑰嚮鍐呭锛屽啀鐐瑰嚮閬僵鏃犳硶鍏抽棴鐨凚ug +## 1.4.4锛�2021-06-18锛� +- 淇 H5骞冲彴涓棿寮瑰嚭鍚庯紝鐐瑰嚮鍐呭锛屽啀鐐瑰嚮閬僵鏃犳硶鍏抽棴鐨凚ug +## 1.4.3锛�2021-06-08锛� +- 淇 閿欒鐨� watch 瀛楁 +- 淇 safeArea 灞炴�т笉鐢熸晥鐨勯棶棰� +- 淇 鐐瑰嚮鍐呭锛屽啀鐐瑰嚮閬僵鏃犳硶鍏抽棴鐨凚ug +## 1.4.2锛�2021-05-12锛� +- 鏂板 缁勪欢绀轰緥鍦板潃 +## 1.4.1锛�2021-04-29锛� +- 淇 缁勪欢鍐呮斁缃� input 銆乼extarea 缁勪欢锛屾棤娉曡仛鐒︾殑闂 +## 1.4.0 锛�2021-04-29锛� +- 鏂板 type 灞炴�х殑 left\right 鍊硷紝鏀寔宸﹀彸寮瑰嚭 +- 鏂板 open(String:type) 鏂规硶鍙傛暟 锛屽彲浠ョ渷鐣� type 灞炴�� 锛岀洿鎺ヤ紶鍏ョ被鍨嬫墦寮�鎸囧畾寮圭獥 +- 鏂板 backgroundColor 灞炴�э紝鍙畾涔変富绐楀彛鑳屾櫙鑹�,榛樿涓嶆樉绀鸿儗鏅壊 +- 鏂板 safeArea 灞炴�э紝鏄惁閫傞厤搴曢儴瀹夊叏鍖� +- 淇 App\h5\寰俊灏忕▼搴忓簳閮ㄥ畨鍏ㄥ尯鍗犱綅涓嶅鐨凚ug +- 淇 App 绔脊鍑虹瓑寰呯殑Bug +- 浼樺寲 鎻愬崌浣庨厤璁惧鎬ц兘锛屼紭鍖栧姩鐢诲崱椤块棶棰� +- 浼樺寲 鏇寸畝鍗曠殑缁勪欢鑷畾涔夋柟寮� +## 1.2.9锛�2021-02-05锛� +- 浼樺寲 缁勪欢寮曠敤鍏崇郴锛岄�氳繃uni_modules寮曠敤缁勪欢 +## 1.2.8锛�2021-02-05锛� +- 璋冩暣涓簎ni_modules鐩綍瑙勮寖 +## 1.2.7锛�2021-02-05锛� +- 璋冩暣涓簎ni_modules鐩綍瑙勮寖 +- 鏂板 鏀寔 PC 绔� +- 鏂板 uni-popup-message 銆乽ni-popup-dialog鎵╁睍缁勪欢鏀寔 PC 绔� diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js b/uniapp/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js new file mode 100644 index 0000000..6ef26a2 --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js @@ -0,0 +1,45 @@ +// #ifdef H5 +export default { + name: 'Keypress', + props: { + disable: { + type: Boolean, + default: false + } + }, + mounted () { + const keyNames = { + esc: ['Esc', 'Escape'], + tab: 'Tab', + enter: 'Enter', + space: [' ', 'Spacebar'], + up: ['Up', 'ArrowUp'], + left: ['Left', 'ArrowLeft'], + right: ['Right', 'ArrowRight'], + down: ['Down', 'ArrowDown'], + delete: ['Backspace', 'Delete', 'Del'] + } + const listener = ($event) => { + if (this.disable) { + return + } + const keyName = Object.keys(keyNames).find(key => { + const keyName = $event.key + const value = keyNames[key] + return value === keyName || (Array.isArray(value) && value.includes(keyName)) + }) + if (keyName) { + // 閬垮厤鍜屽叾浠栨寜閿簨浠跺啿绐� + setTimeout(() => { + this.$emit(keyName, {}) + }, 0) + } + } + document.addEventListener('keyup', listener) + this.$once('hook:beforeDestroy', () => { + document.removeEventListener('keyup', listener) + }) + }, + render: () => {} +} +// #endif diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue b/uniapp/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue new file mode 100644 index 0000000..b5eee79 --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue @@ -0,0 +1,275 @@ +<template> + <view class="uni-popup-dialog"> + <view class="uni-dialog-title"> + <text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{titleText}}</text> + </view> + <view v-if="mode === 'base'" class="uni-dialog-content"> + <slot> + <text class="uni-dialog-content-text">{{content}}</text> + </slot> + </view> + <view v-else class="uni-dialog-content"> + <slot> + <input class="uni-dialog-input" v-model="val" :type="inputType" :placeholder="placeholderText" :focus="focus" > + </slot> + </view> + <view class="uni-dialog-button-group"> + <view class="uni-dialog-button" @click="closeDialog"> + <text class="uni-dialog-button-text">{{closeText}}</text> + </view> + <view class="uni-dialog-button uni-border-left" @click="onOk"> + <text class="uni-dialog-button-text uni-button-color">{{okText}}</text> + </view> + </view> + + </view> +</template> + +<script> + import popup from '../uni-popup/popup.js' + import { + initVueI18n + } from '@dcloudio/uni-i18n' + import messages from '../uni-popup/i18n/index.js' + const { t } = initVueI18n(messages) + /** + * PopUp 寮瑰嚭灞�-瀵硅瘽妗嗘牱寮� + * @description 寮瑰嚭灞�-瀵硅瘽妗嗘牱寮� + * @tutorial https://ext.dcloud.net.cn/plugin?id=329 + * @property {String} value input 妯″紡涓嬬殑榛樿鍊� + * @property {String} placeholder input 妯″紡涓嬭緭鍏ユ彁绀� + * @property {String} type = [success|warning|info|error] 涓婚鏍峰紡 + * @value success 鎴愬姛 + * @value warning 鎻愮ず + * @value info 娑堟伅 + * @value error 閿欒 + * @property {String} mode = [base|input] 妯″紡銆� + * @value base 鍩虹瀵硅瘽妗� + * @value input 鍙緭鍏ュ璇濇 + * @property {String} content 瀵硅瘽妗嗗唴瀹� + * @property {Boolean} beforeClose 鏄惁鎷︽埅鍙栨秷浜嬩欢 + * @event {Function} confirm 鐐瑰嚮纭鎸夐挳瑙﹀彂 + * @event {Function} close 鐐瑰嚮鍙栨秷鎸夐挳瑙﹀彂 + */ + + export default { + name: "uniPopupDialog", + mixins: [popup], + emits:['confirm','close'], + props: { + inputType:{ + type: String, + default: 'text' + }, + value: { + type: [String, Number], + default: '' + }, + placeholder: { + type: [String, Number], + default: '' + }, + type: { + type: String, + default: 'error' + }, + mode: { + type: String, + default: 'base' + }, + title: { + type: String, + default: '' + }, + content: { + type: String, + default: '' + }, + beforeClose: { + type: Boolean, + default: false + }, + cancelText:{ + type: String, + default: '' + }, + confirmText:{ + type: String, + default: '' + } + }, + data() { + return { + dialogType: 'error', + focus: false, + val: "" + } + }, + computed: { + okText() { + return this.confirmText || t("uni-popup.ok") + }, + closeText() { + return this.cancelText || t("uni-popup.cancel") + }, + placeholderText() { + return this.placeholder || t("uni-popup.placeholder") + }, + titleText() { + return this.title || t("uni-popup.title") + } + }, + watch: { + type(val) { + this.dialogType = val + }, + mode(val) { + if (val === 'input') { + this.dialogType = 'info' + } + }, + value(val) { + this.val = val + } + }, + created() { + // 瀵硅瘽妗嗛伄缃╀笉鍙偣鍑� + this.popup.disableMask() + // this.popup.closeMask() + if (this.mode === 'input') { + this.dialogType = 'info' + this.val = this.value + } else { + this.dialogType = this.type + } + }, + mounted() { + this.focus = true + }, + methods: { + /** + * 鐐瑰嚮纭鎸夐挳 + */ + onOk() { + if (this.mode === 'input'){ + this.$emit('confirm', this.val) + }else{ + this.$emit('confirm') + } + if(this.beforeClose) return + this.popup.close() + }, + /** + * 鐐瑰嚮鍙栨秷鎸夐挳 + */ + closeDialog() { + this.$emit('close') + if(this.beforeClose) return + this.popup.close() + }, + close(){ + this.popup.close() + } + } + } +</script> + +<style lang="scss" > + .uni-popup-dialog { + width: 300px; + border-radius: 11px; + background-color: #fff; + } + + .uni-dialog-title { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + justify-content: center; + padding-top: 25px; + } + + .uni-dialog-title-text { + font-size: 16px; + font-weight: 500; + } + + .uni-dialog-content { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + justify-content: center; + align-items: center; + padding: 20px; + } + + .uni-dialog-content-text { + font-size: 14px; + color: #6C6C6C; + } + + .uni-dialog-button-group { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + border-top-color: #f5f5f5; + border-top-style: solid; + border-top-width: 1px; + } + + .uni-dialog-button { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + + flex: 1; + flex-direction: row; + justify-content: center; + align-items: center; + height: 45px; + } + + .uni-border-left { + border-left-color: #f0f0f0; + border-left-style: solid; + border-left-width: 1px; + } + + .uni-dialog-button-text { + font-size: 16px; + color: #333; + } + + .uni-button-color { + color: #007aff; + } + + .uni-dialog-input { + flex: 1; + font-size: 14px; + border: 1px #eee solid; + height: 40px; + padding: 0 10px; + border-radius: 5px; + color: #555; + } + + .uni-popup__success { + color: #4cd964; + } + + .uni-popup__warn { + color: #f0ad4e; + } + + .uni-popup__error { + color: #dd524d; + } + + .uni-popup__info { + color: #909399; + } +</style> diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue b/uniapp/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue new file mode 100644 index 0000000..91370a8 --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue @@ -0,0 +1,143 @@ +<template> + <view class="uni-popup-message"> + <view class="uni-popup-message__box fixforpc-width" :class="'uni-popup__'+type"> + <slot> + <text class="uni-popup-message-text" :class="'uni-popup__'+type+'-text'">{{message}}</text> + </slot> + </view> + </view> +</template> + +<script> + import popup from '../uni-popup/popup.js' + /** + * PopUp 寮瑰嚭灞�-娑堟伅鎻愮ず + * @description 寮瑰嚭灞�-娑堟伅鎻愮ず + * @tutorial https://ext.dcloud.net.cn/plugin?id=329 + * @property {String} type = [success|warning|info|error] 涓婚鏍峰紡 + * @value success 鎴愬姛 + * @value warning 鎻愮ず + * @value info 娑堟伅 + * @value error 閿欒 + * @property {String} message 娑堟伅鎻愮ず鏂囧瓧 + * @property {String} duration 鏄剧ず鏃堕棿锛岃缃负 0 鍒欎笉浼氳嚜鍔ㄥ叧闂� + */ + + export default { + name: 'uniPopupMessage', + mixins:[popup], + props: { + /** + * 涓婚 success/warning/info/error 榛樿 success + */ + type: { + type: String, + default: 'success' + }, + /** + * 娑堟伅鏂囧瓧 + */ + message: { + type: String, + default: '' + }, + /** + * 鏄剧ず鏃堕棿锛岃缃负 0 鍒欎笉浼氳嚜鍔ㄥ叧闂� + */ + duration: { + type: Number, + default: 3000 + }, + maskShow:{ + type:Boolean, + default:false + } + }, + data() { + return {} + }, + created() { + this.popup.maskShow = this.maskShow + this.popup.messageChild = this + }, + methods: { + timerClose(){ + if(this.duration === 0) return + clearTimeout(this.timer) + this.timer = setTimeout(()=>{ + this.popup.close() + },this.duration) + } + } + } +</script> +<style lang="scss" > + .uni-popup-message { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + justify-content: center; + } + + .uni-popup-message__box { + background-color: #e1f3d8; + padding: 10px 15px; + border-color: #eee; + border-style: solid; + border-width: 1px; + flex: 1; + } + + @media screen and (min-width: 500px) { + .fixforpc-width { + margin-top: 20px; + border-radius: 4px; + flex: none; + min-width: 380px; + /* #ifndef APP-NVUE */ + max-width: 50%; + /* #endif */ + /* #ifdef APP-NVUE */ + max-width: 500px; + /* #endif */ + } + } + + .uni-popup-message-text { + font-size: 14px; + padding: 0; + } + + .uni-popup__success { + background-color: #e1f3d8; + } + + .uni-popup__success-text { + color: #67C23A; + } + + .uni-popup__warn { + background-color: #faecd8; + } + + .uni-popup__warn-text { + color: #E6A23C; + } + + .uni-popup__error { + background-color: #fde2e2; + } + + .uni-popup__error-text { + color: #F56C6C; + } + + .uni-popup__info { + background-color: #F2F6FC; + } + + .uni-popup__info-text { + color: #909399; + } +</style> diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue b/uniapp/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue new file mode 100644 index 0000000..5be7624 --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue @@ -0,0 +1,187 @@ +<template> + <view class="uni-popup-share"> + <view class="uni-share-title"><text class="uni-share-title-text">{{shareTitleText}}</text></view> + <view class="uni-share-content"> + <view class="uni-share-content-box"> + <view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)"> + <image class="uni-share-image" :src="item.icon" mode="aspectFill"></image> + <text class="uni-share-text">{{item.text}}</text> + </view> + + </view> + </view> + <view class="uni-share-button-box"> + <button class="uni-share-button" @click="close">{{cancelText}}</button> + </view> + </view> +</template> + +<script> + import popup from '../uni-popup/popup.js' + import { + initVueI18n + } from '@dcloudio/uni-i18n' + import messages from '../uni-popup/i18n/index.js' + const { t } = initVueI18n(messages) + export default { + name: 'UniPopupShare', + mixins:[popup], + emits:['select'], + props: { + title: { + type: String, + default: '' + }, + beforeClose: { + type: Boolean, + default: false + } + }, + data() { + return { + bottomData: [{ + text: '寰俊', + icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/c2b17470-50be-11eb-b680-7980c8a877b8.png', + name: 'wx' + }, + { + text: '鏀粯瀹�', + icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png', + name: 'wx' + }, + { + text: 'QQ', + icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/e7a79520-50be-11eb-b997-9918a5dda011.png', + name: 'qq' + }, + { + text: '鏂版氮', + icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/0dacdbe0-50bf-11eb-8ff1-d5dcf8779628.png', + name: 'sina' + }, + // { + // text: '鐧惧害', + // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/1ec6e920-50bf-11eb-8a36-ebb87efcf8c0.png', + // name: 'copy' + // }, + // { + // text: '鍏朵粬', + // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/2e0fdfe0-50bf-11eb-b997-9918a5dda011.png', + // name: 'more' + // } + ] + } + }, + created() {}, + computed: { + cancelText() { + return t("uni-popup.cancel") + }, + shareTitleText() { + return this.title || t("uni-popup.shareTitle") + } + }, + methods: { + /** + * 閫夋嫨鍐呭 + */ + select(item, index) { + this.$emit('select', { + item, + index + }) + this.close() + + }, + /** + * 鍏抽棴绐楀彛 + */ + close() { + if(this.beforeClose) return + this.popup.close() + } + } + } +</script> +<style lang="scss" > + .uni-popup-share { + background-color: #fff; + border-top-left-radius: 11px; + border-top-right-radius: 11px; + } + .uni-share-title { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + align-items: center; + justify-content: center; + height: 40px; + } + .uni-share-title-text { + font-size: 14px; + color: #666; + } + .uni-share-content { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + justify-content: center; + padding-top: 10px; + } + + .uni-share-content-box { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + flex-wrap: wrap; + width: 360px; + } + + .uni-share-content-item { + width: 90px; + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: column; + justify-content: center; + padding: 10px 0; + align-items: center; + } + + .uni-share-content-item:active { + background-color: #f5f5f5; + } + + .uni-share-image { + width: 30px; + height: 30px; + } + + .uni-share-text { + margin-top: 10px; + font-size: 14px; + color: #3B4144; + } + + .uni-share-button-box { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + padding: 10px 15px; + } + + .uni-share-button { + flex: 1; + border-radius: 50px; + color: #666; + font-size: 16px; + } + + .uni-share-button::after { + border-radius: 50px; + } +</style> diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/en.json b/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/en.json new file mode 100644 index 0000000..7f1bd06 --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/en.json @@ -0,0 +1,7 @@ +{ + "uni-popup.cancel": "cancel", + "uni-popup.ok": "ok", + "uni-popup.placeholder": "pleace enter", + "uni-popup.title": "Hint", + "uni-popup.shareTitle": "Share to" +} diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/index.js b/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/index.js new file mode 100644 index 0000000..de7509c --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/index.js @@ -0,0 +1,8 @@ +import en from './en.json' +import zhHans from './zh-Hans.json' +import zhHant from './zh-Hant.json' +export default { + en, + 'zh-Hans': zhHans, + 'zh-Hant': zhHant +} diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json b/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json new file mode 100644 index 0000000..5e3003c --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json @@ -0,0 +1,7 @@ +{ + "uni-popup.cancel": "鍙栨秷", + "uni-popup.ok": "纭畾", + "uni-popup.placeholder": "璇疯緭鍏�", + "uni-popup.title": "鎻愮ず", + "uni-popup.shareTitle": "鍒嗕韩鍒�" +} diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json b/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json new file mode 100644 index 0000000..13e39eb --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json @@ -0,0 +1,7 @@ +{ + "uni-popup.cancel": "鍙栨秷", + "uni-popup.ok": "纰哄畾", + "uni-popup.placeholder": "璜嬭几鍏�", + "uni-popup.title": "鎻愮ず", + "uni-popup.shareTitle": "鍒嗕韩鍒�" +} diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup/keypress.js b/uniapp/uni_modules/uni-popup/components/uni-popup/keypress.js new file mode 100644 index 0000000..62dda46 --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup/keypress.js @@ -0,0 +1,45 @@ +// #ifdef H5 +export default { + name: 'Keypress', + props: { + disable: { + type: Boolean, + default: false + } + }, + mounted () { + const keyNames = { + esc: ['Esc', 'Escape'], + tab: 'Tab', + enter: 'Enter', + space: [' ', 'Spacebar'], + up: ['Up', 'ArrowUp'], + left: ['Left', 'ArrowLeft'], + right: ['Right', 'ArrowRight'], + down: ['Down', 'ArrowDown'], + delete: ['Backspace', 'Delete', 'Del'] + } + const listener = ($event) => { + if (this.disable) { + return + } + const keyName = Object.keys(keyNames).find(key => { + const keyName = $event.key + const value = keyNames[key] + return value === keyName || (Array.isArray(value) && value.includes(keyName)) + }) + if (keyName) { + // 閬垮厤鍜屽叾浠栨寜閿簨浠跺啿绐� + setTimeout(() => { + this.$emit(keyName, {}) + }, 0) + } + } + document.addEventListener('keyup', listener) + // this.$once('hook:beforeDestroy', () => { + // document.removeEventListener('keyup', listener) + // }) + }, + render: () => {} +} +// #endif diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup/popup.js b/uniapp/uni_modules/uni-popup/components/uni-popup/popup.js new file mode 100644 index 0000000..c4e5781 --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup/popup.js @@ -0,0 +1,26 @@ + +export default { + data() { + return { + + } + }, + created(){ + this.popup = this.getParent() + }, + methods:{ + /** + * 鑾峰彇鐖跺厓绱犲疄渚� + */ + getParent(name = 'uniPopup') { + let parent = this.$parent; + let parentName = parent.$options.name; + while (parentName !== name) { + parent = parent.$parent; + if (!parent) return false + parentName = parent.$options.name; + } + return parent; + }, + } +} diff --git a/uniapp/uni_modules/uni-popup/components/uni-popup/uni-popup.vue b/uniapp/uni_modules/uni-popup/components/uni-popup/uni-popup.vue new file mode 100644 index 0000000..54afee2 --- /dev/null +++ b/uniapp/uni_modules/uni-popup/components/uni-popup/uni-popup.vue @@ -0,0 +1,473 @@ +<template> + <view v-if="showPopup" class="uni-popup" :class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']"> + <view @touchstart="touchstart"> + <uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass" + :duration="duration" :show="showTrans" @click="onTap" /> + <uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration" + :show="showTrans" @click="onTap"> + <view class="uni-popup__wrapper" :style="{ backgroundColor: bg }" :class="[popupstyle]" @click="clear"> + <slot /> + </view> + </uni-transition> + </view> + <!-- #ifdef H5 --> + <keypress v-if="maskShow" @esc="onTap" /> + <!-- #endif --> + </view> +</template> + +<script> + // #ifdef H5 + import keypress from './keypress.js' + // #endif + + /** + * PopUp 寮瑰嚭灞� + * @description 寮瑰嚭灞傜粍浠讹紝涓轰簡瑙e喅閬僵寮瑰眰鐨勯棶棰� + * @tutorial https://ext.dcloud.net.cn/plugin?id=329 + * @property {String} type = [top|center|bottom|left|right|message|dialog|share] 寮瑰嚭鏂瑰紡 + * @value top 椤堕儴寮瑰嚭 + * @value center 涓棿寮瑰嚭 + * @value bottom 搴曢儴寮瑰嚭 + * @value left 宸︿晶寮瑰嚭 + * @value right 鍙充晶寮瑰嚭 + * @value message 娑堟伅鎻愮ず + * @value dialog 瀵硅瘽妗� + * @value share 搴曢儴鍒嗕韩绀轰緥 + * @property {Boolean} animation = [true|false] 鏄惁寮�鍚姩鐢� + * @property {Boolean} maskClick = [true|false] 钂欑増鐐瑰嚮鏄惁鍏抽棴寮圭獥(搴熷純) + * @property {Boolean} isMaskClick = [true|false] 钂欑増鐐瑰嚮鏄惁鍏抽棴寮圭獥 + * @property {String} backgroundColor 涓荤獥鍙h儗鏅壊 + * @property {String} maskBackgroundColor 钂欑増棰滆壊 + * @property {Boolean} safeArea 鏄惁閫傞厤搴曢儴瀹夊叏鍖� + * @event {Function} change 鎵撳紑鍏抽棴寮圭獥瑙﹀彂锛宔={show: false} + * @event {Function} maskClick 鐐瑰嚮閬僵瑙﹀彂 + */ + + export default { + name: 'uniPopup', + components: { + // #ifdef H5 + keypress + // #endif + }, + emits: ['change', 'maskClick'], + props: { + // 寮�鍚姩鐢� + animation: { + type: Boolean, + default: true + }, + // 寮瑰嚭灞傜被鍨嬶紝鍙�夊�硷紝top: 椤堕儴寮瑰嚭灞傦紱bottom锛氬簳閮ㄥ脊鍑哄眰锛沜enter锛氬叏灞忓脊鍑哄眰 + // message: 娑堟伅鎻愮ず ; dialog : 瀵硅瘽妗� + type: { + type: String, + default: 'center' + }, + // maskClick + isMaskClick: { + type: Boolean, + default: null + }, + // TODO 2 涓増鏈悗搴熷純灞炴�� 锛屼娇鐢� isMaskClick + maskClick: { + type: Boolean, + default: null + }, + backgroundColor: { + type: String, + default: 'none' + }, + safeArea: { + type: Boolean, + default: true + }, + maskBackgroundColor: { + type: String, + default: 'rgba(0, 0, 0, 0.4)' + }, + }, + + watch: { + /** + * 鐩戝惉type绫诲瀷 + */ + type: { + handler: function(type) { + if (!this.config[type]) return + this[this.config[type]](true) + }, + immediate: true + }, + isDesktop: { + handler: function(newVal) { + if (!this.config[newVal]) return + this[this.config[this.type]](true) + }, + immediate: true + }, + /** + * 鐩戝惉閬僵鏄惁鍙偣鍑� + * @param {Object} val + */ + maskClick: { + handler: function(val) { + this.mkclick = val + }, + immediate: true + }, + isMaskClick: { + handler: function(val) { + this.mkclick = val + }, + immediate: true + }, + // H5 涓嬬姝㈠簳閮ㄦ粴鍔� + showPopup(show) { + // #ifdef H5 + // fix by mehaotian 澶勭悊 h5 婊氬姩绌块�忕殑闂 + document.getElementsByTagName('body')[0].style.overflow = show ? 'hidden' : 'visible' + // #endif + } + }, + data() { + return { + duration: 300, + ani: [], + showPopup: false, + showTrans: false, + popupWidth: 0, + popupHeight: 0, + config: { + top: 'top', + bottom: 'bottom', + center: 'center', + left: 'left', + right: 'right', + message: 'top', + dialog: 'center', + share: 'bottom' + }, + maskClass: { + position: 'fixed', + bottom: 0, + top: 0, + left: 0, + right: 0, + backgroundColor: 'rgba(0, 0, 0, 0.4)' + }, + transClass: { + position: 'fixed', + left: 0, + right: 0 + }, + maskShow: true, + mkclick: true, + popupstyle: this.isDesktop ? 'fixforpc-top' : 'top' + } + }, + computed: { + isDesktop() { + return this.popupWidth >= 500 && this.popupHeight >= 500 + }, + bg() { + if (this.backgroundColor === '' || this.backgroundColor === 'none') { + return 'transparent' + } + return this.backgroundColor + } + }, + mounted() { + const fixSize = () => { + const { + windowWidth, + windowHeight, + windowTop, + safeArea, + screenHeight, + safeAreaInsets + } = uni.getSystemInfoSync() + this.popupWidth = windowWidth + this.popupHeight = windowHeight + (windowTop || 0) + // TODO fix by mehaotian 鏄惁閫傞厤搴曢儴瀹夊叏鍖� ,鐩墠寰俊ios 銆佸拰 app ios 璁$畻鏈夊樊寮傦紝闇�瑕佹鏋朵慨澶� + if (safeArea && this.safeArea) { + // #ifdef MP-WEIXIN + this.safeAreaInsets = screenHeight - safeArea.bottom + // #endif + // #ifndef MP-WEIXIN + this.safeAreaInsets = safeAreaInsets.bottom + // #endif + } else { + this.safeAreaInsets = 0 + } + } + fixSize() + // #ifdef H5 + // window.addEventListener('resize', fixSize) + // this.$once('hook:beforeDestroy', () => { + // window.removeEventListener('resize', fixSize) + // }) + // #endif + }, + // #ifndef VUE3 + // TODO vue2 + destroyed() { + this.setH5Visible() + }, + // #endif + // #ifdef VUE3 + // TODO vue3 + unmounted() { + this.setH5Visible() + }, + // #endif + created() { + // this.mkclick = this.isMaskClick || this.maskClick + if (this.isMaskClick === null && this.maskClick === null) { + this.mkclick = true + } else { + this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick + } + if (this.animation) { + this.duration = 300 + } else { + this.duration = 0 + } + // TODO 澶勭悊 message 缁勪欢鐢熷懡鍛ㄦ湡寮傚父鐨勯棶棰� + this.messageChild = null + // TODO 瑙e喅澶存潯鍐掓场鐨勯棶棰� + this.clearPropagation = false + this.maskClass.backgroundColor = this.maskBackgroundColor + }, + methods: { + setH5Visible() { + // #ifdef H5 + // fix by mehaotian 澶勭悊 h5 婊氬姩绌块�忕殑闂 + document.getElementsByTagName('body')[0].style.overflow = 'visible' + // #endif + }, + /** + * 鍏敤鏂规硶锛屼笉鏄剧ず閬僵灞� + */ + closeMask() { + this.maskShow = false + }, + /** + * 鍏敤鏂规硶锛岄伄缃╁眰绂佹鐐瑰嚮 + */ + disableMask() { + this.mkclick = false + }, + // TODO nvue 鍙栨秷鍐掓场 + clear(e) { + // #ifndef APP-NVUE + e.stopPropagation() + // #endif + this.clearPropagation = true + }, + + open(direction) { + // fix by mehaotian 澶勭悊蹇�熸墦寮�鍏抽棴鐨勬儏鍐� + if (this.showPopup) { + return + } + let innerType = ['top', 'center', 'bottom', 'left', 'right', 'message', 'dialog', 'share'] + if (!(direction && innerType.indexOf(direction) !== -1)) { + direction = this.type + } + if (!this.config[direction]) { + console.error('缂哄皯绫诲瀷锛�', direction) + return + } + this[this.config[direction]]() + this.$emit('change', { + show: true, + type: direction + }) + }, + close(type) { + this.showTrans = false + this.$emit('change', { + show: false, + type: this.type + }) + clearTimeout(this.timer) + // // 鑷畾涔夊叧闂簨浠� + // this.customOpen && this.customClose() + this.timer = setTimeout(() => { + this.showPopup = false + }, 300) + }, + // TODO 澶勭悊鍐掓场浜嬩欢锛屽ご鏉$殑鍐掓场浜嬩欢鏈夐棶棰� 锛屽厛杩欐牱鍏煎 + touchstart() { + this.clearPropagation = false + }, + + onTap() { + if (this.clearPropagation) { + // fix by mehaotian 鍏煎 nvue + this.clearPropagation = false + return + } + this.$emit('maskClick') + if (!this.mkclick) return + this.close() + }, + /** + * 椤堕儴寮瑰嚭鏍峰紡澶勭悊 + */ + top(type) { + this.popupstyle = this.isDesktop ? 'fixforpc-top' : 'top' + this.ani = ['slide-top'] + this.transClass = { + position: 'fixed', + left: 0, + right: 0, + backgroundColor: this.bg + } + // TODO 鍏煎 type 灞炴�� 锛屽悗缁細搴熷純 + if (type) return + this.showPopup = true + this.showTrans = true + this.$nextTick(() => { + if (this.messageChild && this.type === 'message') { + this.messageChild.timerClose() + } + }) + }, + /** + * 搴曢儴寮瑰嚭鏍峰紡澶勭悊 + */ + bottom(type) { + this.popupstyle = 'bottom' + this.ani = ['slide-bottom'] + this.transClass = { + position: 'fixed', + left: 0, + right: 0, + bottom: 0, + paddingBottom: this.safeAreaInsets + 'px', + backgroundColor: this.bg + } + // TODO 鍏煎 type 灞炴�� 锛屽悗缁細搴熷純 + if (type) return + this.showPopup = true + this.showTrans = true + }, + /** + * 涓棿寮瑰嚭鏍峰紡澶勭悊 + */ + center(type) { + this.popupstyle = 'center' + this.ani = ['zoom-out', 'fade'] + this.transClass = { + position: 'fixed', + /* #ifndef APP-NVUE */ + display: 'flex', + flexDirection: 'column', + /* #endif */ + bottom: 0, + left: 0, + right: 0, + top: 0, + justifyContent: 'center', + alignItems: 'center' + } + // TODO 鍏煎 type 灞炴�� 锛屽悗缁細搴熷純 + if (type) return + this.showPopup = true + this.showTrans = true + }, + left(type) { + this.popupstyle = 'left' + this.ani = ['slide-left'] + this.transClass = { + position: 'fixed', + left: 0, + bottom: 0, + top: 0, + backgroundColor: this.bg, + /* #ifndef APP-NVUE */ + display: 'flex', + flexDirection: 'column' + /* #endif */ + } + // TODO 鍏煎 type 灞炴�� 锛屽悗缁細搴熷純 + if (type) return + this.showPopup = true + this.showTrans = true + }, + right(type) { + this.popupstyle = 'right' + this.ani = ['slide-right'] + this.transClass = { + position: 'fixed', + bottom: 0, + right: 0, + top: 0, + backgroundColor: this.bg, + /* #ifndef APP-NVUE */ + display: 'flex', + flexDirection: 'column' + /* #endif */ + } + // TODO 鍏煎 type 灞炴�� 锛屽悗缁細搴熷純 + if (type) return + this.showPopup = true + this.showTrans = true + } + } + } +</script> +<style lang="scss"> + .uni-popup { + position: fixed; + /* #ifndef APP-NVUE */ + z-index: 99; + + /* #endif */ + &.top, + &.left, + &.right { + /* #ifdef H5 */ + top: var(--window-top); + /* #endif */ + /* #ifndef H5 */ + top: 0; + /* #endif */ + } + + .uni-popup__wrapper { + /* #ifndef APP-NVUE */ + display: block; + /* #endif */ + position: relative; + + /* iphonex 绛夊畨鍏ㄥ尯璁剧疆锛屽簳閮ㄥ畨鍏ㄥ尯閫傞厤 */ + /* #ifndef APP-NVUE */ + // padding-bottom: constant(safe-area-inset-bottom); + // padding-bottom: env(safe-area-inset-bottom); + /* #endif */ + &.left, + &.right { + /* #ifdef H5 */ + padding-top: var(--window-top); + /* #endif */ + /* #ifndef H5 */ + padding-top: 0; + /* #endif */ + flex: 1; + } + } + } + + .fixforpc-z-index { + /* #ifndef APP-NVUE */ + z-index: 999; + /* #endif */ + } + + .fixforpc-top { + top: 0; + } +</style> diff --git a/uniapp/uni_modules/uni-popup/package.json b/uniapp/uni_modules/uni-popup/package.json new file mode 100644 index 0000000..f40556b --- /dev/null +++ b/uniapp/uni_modules/uni-popup/package.json @@ -0,0 +1,87 @@ +{ + "id": "uni-popup", + "displayName": "uni-popup 寮瑰嚭灞�", + "version": "1.8.3", + "description": " Popup 缁勪欢锛屾彁渚涘父鐢ㄧ殑寮瑰眰", + "keywords": [ + "uni-ui", + "寮瑰嚭灞�", + "寮圭獥", + "popup", + "寮规" + ], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "鏃�", + "data": "鏃�", + "permissions": "鏃�" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-transition" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "寰俊娴忚鍣�(Android)": "y", + "QQ娴忚鍣�(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "灏忕▼搴�": { + "寰俊": "y", + "闃块噷": "y", + "鐧惧害": "y", + "瀛楄妭璺冲姩": "y", + "QQ": "y" + }, + "蹇簲鐢�": { + "鍗庝负": "u", + "鑱旂洘": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uniapp/uni_modules/uni-popup/readme.md b/uniapp/uni_modules/uni-popup/readme.md new file mode 100644 index 0000000..fdad4b3 --- /dev/null +++ b/uniapp/uni_modules/uni-popup/readme.md @@ -0,0 +1,17 @@ + + +## Popup 寮瑰嚭灞� +> **缁勪欢鍚嶏細uni-popup** +> 浠g爜鍧楋細 `uPopup` +> 鍏宠仈缁勪欢锛歚uni-transition` + + +寮瑰嚭灞傜粍浠讹紝鍦ㄥ簲鐢ㄤ腑寮瑰嚭涓�涓秷鎭彁绀虹獥鍙c�佹彁绀烘绛� + +### [鏌ョ湅鏂囨。](https://uniapp.dcloud.io/component/uniui/uni-popup) +#### 濡備娇鐢ㄨ繃绋嬩腑鏈変换浣曢棶棰橈紝鎴栬�呮偍瀵箄ni-ui鏈変竴浜涘ソ鐨勫缓璁紝娆㈣繋鍔犲叆 uni-ui 浜ゆ祦缇わ細871950839 + + + + + diff --git a/uniapp/uni_modules/uni-scss/changelog.md b/uniapp/uni_modules/uni-scss/changelog.md new file mode 100644 index 0000000..b863bb0 --- /dev/null +++ b/uniapp/uni_modules/uni-scss/changelog.md @@ -0,0 +1,8 @@ +## 1.0.3锛�2022-01-21锛� +- 浼樺寲 缁勪欢绀轰緥 +## 1.0.2锛�2021-11-22锛� +- 淇 / 绗﹀彿鍦� vue 涓嶅悓鐗堟湰鍏煎闂寮曡捣鐨勬姤閿欓棶棰� +## 1.0.1锛�2021-11-22锛� +- 淇 vue3涓璼css璇硶鍏煎闂 +## 1.0.0锛�2021-11-18锛� +- init diff --git a/uniapp/uni_modules/uni-scss/index.scss b/uniapp/uni_modules/uni-scss/index.scss new file mode 100644 index 0000000..1744a5f --- /dev/null +++ b/uniapp/uni_modules/uni-scss/index.scss @@ -0,0 +1 @@ +@import './styles/index.scss'; diff --git a/uniapp/uni_modules/uni-scss/package.json b/uniapp/uni_modules/uni-scss/package.json new file mode 100644 index 0000000..7cc0ccb --- /dev/null +++ b/uniapp/uni_modules/uni-scss/package.json @@ -0,0 +1,82 @@ +{ + "id": "uni-scss", + "displayName": "uni-scss 杈呭姪鏍峰紡", + "version": "1.0.3", + "description": "uni-sass鏄痷ni-ui鎻愪緵鐨勪竴濂楀叏灞�鏍峰紡 锛岄�氳繃涓�浜涚畝鍗曠殑绫诲悕鍜宻ass鍙橀噺锛屽疄鐜扮畝鍗曠殑椤甸潰甯冨眬鎿嶄綔锛屾瘮濡傞鑹层�佽竟璺濄�佸渾瑙掔瓑銆�", + "keywords": [ + "uni-scss", + "uni-ui", + "杈呭姪鏍峰紡" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "category": [ + "JS SDK", + "閫氱敤 SDK" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "鏃�", + "data": "鏃�", + "permissions": "鏃�" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "u" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "寰俊娴忚鍣�(Android)": "y", + "QQ娴忚鍣�(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "灏忕▼搴�": { + "寰俊": "y", + "闃块噷": "y", + "鐧惧害": "y", + "瀛楄妭璺冲姩": "y", + "QQ": "y" + }, + "蹇簲鐢�": { + "鍗庝负": "n", + "鑱旂洘": "n" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uniapp/uni_modules/uni-scss/readme.md b/uniapp/uni_modules/uni-scss/readme.md new file mode 100644 index 0000000..b7d1c25 --- /dev/null +++ b/uniapp/uni_modules/uni-scss/readme.md @@ -0,0 +1,4 @@ +`uni-sass` 鏄� `uni-ui`鎻愪緵鐨勪竴濂楀叏灞�鏍峰紡 锛岄�氳繃涓�浜涚畝鍗曠殑绫诲悕鍜宍sass`鍙橀噺锛屽疄鐜扮畝鍗曠殑椤甸潰甯冨眬鎿嶄綔锛屾瘮濡傞鑹层�佽竟璺濄�佸渾瑙掔瓑銆� + +### [鏌ョ湅鏂囨。](https://uniapp.dcloud.io/component/uniui/uni-sass) +#### 濡備娇鐢ㄨ繃绋嬩腑鏈変换浣曢棶棰橈紝鎴栬�呮偍瀵箄ni-ui鏈変竴浜涘ソ鐨勫缓璁紝娆㈣繋鍔犲叆 uni-ui 浜ゆ祦缇わ細871950839 \ No newline at end of file diff --git a/uniapp/uni_modules/uni-scss/styles/index.scss b/uniapp/uni_modules/uni-scss/styles/index.scss new file mode 100644 index 0000000..ffac4fe --- /dev/null +++ b/uniapp/uni_modules/uni-scss/styles/index.scss @@ -0,0 +1,7 @@ +@import './setting/_variables.scss'; +@import './setting/_border.scss'; +@import './setting/_color.scss'; +@import './setting/_space.scss'; +@import './setting/_radius.scss'; +@import './setting/_text.scss'; +@import './setting/_styles.scss'; diff --git a/uniapp/uni_modules/uni-scss/styles/setting/_border.scss b/uniapp/uni_modules/uni-scss/styles/setting/_border.scss new file mode 100644 index 0000000..12a11c3 --- /dev/null +++ b/uniapp/uni_modules/uni-scss/styles/setting/_border.scss @@ -0,0 +1,3 @@ +.uni-border { + border: 1px $uni-border-1 solid; +} \ No newline at end of file diff --git a/uniapp/uni_modules/uni-scss/styles/setting/_color.scss b/uniapp/uni_modules/uni-scss/styles/setting/_color.scss new file mode 100644 index 0000000..1ededd9 --- /dev/null +++ b/uniapp/uni_modules/uni-scss/styles/setting/_color.scss @@ -0,0 +1,66 @@ + +// TODO 鏆傛椂涓嶉渶瑕� class 锛岄渶瑕佺敤鎴蜂娇鐢ㄥ彉閲忓疄鐜� 锛屽鏋滀娇鐢ㄧ被鍚嶅叾瀹炲苟涓嶆帹鑽� +// @mixin get-styles($k,$c) { +// @if $k == size or $k == weight{ +// font-#{$k}:#{$c} +// }@else{ +// #{$k}:#{$c} +// } +// } +$uni-ui-color:( + // 涓昏壊 + primary: $uni-primary, + primary-disable: $uni-primary-disable, + primary-light: $uni-primary-light, + // 杈呭姪鑹� + success: $uni-success, + success-disable: $uni-success-disable, + success-light: $uni-success-light, + warning: $uni-warning, + warning-disable: $uni-warning-disable, + warning-light: $uni-warning-light, + error: $uni-error, + error-disable: $uni-error-disable, + error-light: $uni-error-light, + info: $uni-info, + info-disable: $uni-info-disable, + info-light: $uni-info-light, + // 涓�ц壊 + main-color: $uni-main-color, + base-color: $uni-base-color, + secondary-color: $uni-secondary-color, + extra-color: $uni-extra-color, + // 鑳屾櫙鑹� + bg-color: $uni-bg-color, + // 杈规棰滆壊 + border-1: $uni-border-1, + border-2: $uni-border-2, + border-3: $uni-border-3, + border-4: $uni-border-4, + // 榛戣壊 + black:$uni-black, + // 鐧借壊 + white:$uni-white, + // 閫忔槑 + transparent:$uni-transparent +) !default; +@each $key, $child in $uni-ui-color { + .uni-#{"" + $key} { + color: $child; + } + .uni-#{"" + $key}-bg { + background-color: $child; + } +} +.uni-shadow-sm { + box-shadow: $uni-shadow-sm; +} +.uni-shadow-base { + box-shadow: $uni-shadow-base; +} +.uni-shadow-lg { + box-shadow: $uni-shadow-lg; +} +.uni-mask { + background-color:$uni-mask; +} diff --git a/uniapp/uni_modules/uni-scss/styles/setting/_radius.scss b/uniapp/uni_modules/uni-scss/styles/setting/_radius.scss new file mode 100644 index 0000000..9a0428b --- /dev/null +++ b/uniapp/uni_modules/uni-scss/styles/setting/_radius.scss @@ -0,0 +1,55 @@ +@mixin radius($r,$d:null ,$important: false){ + $radius-value:map-get($uni-radius, $r) if($important, !important, null); + // Key exists within the $uni-radius variable + @if (map-has-key($uni-radius, $r) and $d){ + @if $d == t { + border-top-left-radius:$radius-value; + border-top-right-radius:$radius-value; + }@else if $d == r { + border-top-right-radius:$radius-value; + border-bottom-right-radius:$radius-value; + }@else if $d == b { + border-bottom-left-radius:$radius-value; + border-bottom-right-radius:$radius-value; + }@else if $d == l { + border-top-left-radius:$radius-value; + border-bottom-left-radius:$radius-value; + }@else if $d == tl { + border-top-left-radius:$radius-value; + }@else if $d == tr { + border-top-right-radius:$radius-value; + }@else if $d == br { + border-bottom-right-radius:$radius-value; + }@else if $d == bl { + border-bottom-left-radius:$radius-value; + } + }@else{ + border-radius:$radius-value; + } +} + +@each $key, $child in $uni-radius { + @if($key){ + .uni-radius-#{"" + $key} { + @include radius($key) + } + }@else{ + .uni-radius { + @include radius($key) + } + } +} + +@each $direction in t, r, b, l,tl, tr, br, bl { + @each $key, $child in $uni-radius { + @if($key){ + .uni-radius-#{"" + $direction}-#{"" + $key} { + @include radius($key,$direction,false) + } + }@else{ + .uni-radius-#{$direction} { + @include radius($key,$direction,false) + } + } + } +} diff --git a/uniapp/uni_modules/uni-scss/styles/setting/_space.scss b/uniapp/uni_modules/uni-scss/styles/setting/_space.scss new file mode 100644 index 0000000..3c89528 --- /dev/null +++ b/uniapp/uni_modules/uni-scss/styles/setting/_space.scss @@ -0,0 +1,56 @@ + +@mixin fn($space,$direction,$size,$n) { + @if $n { + #{$space}-#{$direction}: #{$size*$uni-space-root}px + } @else { + #{$space}-#{$direction}: #{-$size*$uni-space-root}px + } +} +@mixin get-styles($direction,$i,$space,$n){ + @if $direction == t { + @include fn($space, top,$i,$n); + } + @if $direction == r { + @include fn($space, right,$i,$n); + } + @if $direction == b { + @include fn($space, bottom,$i,$n); + } + @if $direction == l { + @include fn($space, left,$i,$n); + } + @if $direction == x { + @include fn($space, left,$i,$n); + @include fn($space, right,$i,$n); + } + @if $direction == y { + @include fn($space, top,$i,$n); + @include fn($space, bottom,$i,$n); + } + @if $direction == a { + @if $n { + #{$space}:#{$i*$uni-space-root}px; + } @else { + #{$space}:#{-$i*$uni-space-root}px; + } + } +} + +@each $orientation in m,p { + $space: margin; + @if $orientation == m { + $space: margin; + } @else { + $space: padding; + } + @for $i from 0 through 16 { + @each $direction in t, r, b, l, x, y, a { + .uni-#{$orientation}#{$direction}-#{$i} { + @include get-styles($direction,$i,$space,true); + } + .uni-#{$orientation}#{$direction}-n#{$i} { + @include get-styles($direction,$i,$space,false); + } + } + } +} \ No newline at end of file diff --git a/uniapp/uni_modules/uni-scss/styles/setting/_styles.scss b/uniapp/uni_modules/uni-scss/styles/setting/_styles.scss new file mode 100644 index 0000000..689afec --- /dev/null +++ b/uniapp/uni_modules/uni-scss/styles/setting/_styles.scss @@ -0,0 +1,167 @@ +/* #ifndef APP-NVUE */ + +$-color-white:#fff; +$-color-black:#000; +@mixin base-style($color) { + color: #fff; + background-color: $color; + border-color: mix($-color-black, $color, 8%); + &:not([hover-class]):active { + background: mix($-color-black, $color, 10%); + border-color: mix($-color-black, $color, 20%); + color: $-color-white; + outline: none; + } +} +@mixin is-color($color) { + @include base-style($color); + &[loading] { + @include base-style($color); + &::before { + margin-right:5px; + } + } + &[disabled] { + &, + &[loading], + &:not([hover-class]):active { + color: $-color-white; + border-color: mix(darken($color,10%), $-color-white); + background-color: mix($color, $-color-white); + } + } + +} +@mixin base-plain-style($color) { + color:$color; + background-color: mix($-color-white, $color, 90%); + border-color: mix($-color-white, $color, 70%); + &:not([hover-class]):active { + background: mix($-color-white, $color, 80%); + color: $color; + outline: none; + border-color: mix($-color-white, $color, 50%); + } +} +@mixin is-plain($color){ + &[plain] { + @include base-plain-style($color); + &[loading] { + @include base-plain-style($color); + &::before { + margin-right:5px; + } + } + &[disabled] { + &, + &:active { + color: mix($-color-white, $color, 40%); + background-color: mix($-color-white, $color, 90%); + border-color: mix($-color-white, $color, 80%); + } + } + } +} + + +.uni-btn { + margin: 5px; + color: #393939; + border:1px solid #ccc; + font-size: 16px; + font-weight: 200; + background-color: #F9F9F9; + // TODO 鏆傛椂澶勭悊杈规闅愯棌涓�杈圭殑闂 + overflow: visible; + &::after{ + border: none; + } + + &:not([type]),&[type=default] { + color: #999; + &[loading] { + background: none; + &::before { + margin-right:5px; + } + } + + + + &[disabled]{ + color: mix($-color-white, #999, 60%); + &, + &[loading], + &:active { + color: mix($-color-white, #999, 60%); + background-color: mix($-color-white,$-color-black , 98%); + border-color: mix($-color-white, #999, 85%); + } + } + + &[plain] { + color: #999; + background: none; + border-color: $uni-border-1; + &:not([hover-class]):active { + background: none; + color: mix($-color-white, $-color-black, 80%); + border-color: mix($-color-white, $-color-black, 90%); + outline: none; + } + &[disabled]{ + &, + &[loading], + &:active { + background: none; + color: mix($-color-white, #999, 60%); + border-color: mix($-color-white, #999, 85%); + } + } + } + } + + &:not([hover-class]):active { + color: mix($-color-white, $-color-black, 50%); + } + + &[size=mini] { + font-size: 16px; + font-weight: 200; + border-radius: 8px; + } + + + + &.uni-btn-small { + font-size: 14px; + } + &.uni-btn-mini { + font-size: 12px; + } + + &.uni-btn-radius { + border-radius: 999px; + } + &[type=primary] { + @include is-color($uni-primary); + @include is-plain($uni-primary) + } + &[type=success] { + @include is-color($uni-success); + @include is-plain($uni-success) + } + &[type=error] { + @include is-color($uni-error); + @include is-plain($uni-error) + } + &[type=warning] { + @include is-color($uni-warning); + @include is-plain($uni-warning) + } + &[type=info] { + @include is-color($uni-info); + @include is-plain($uni-info) + } +} +/* #endif */ diff --git a/uniapp/uni_modules/uni-scss/styles/setting/_text.scss b/uniapp/uni_modules/uni-scss/styles/setting/_text.scss new file mode 100644 index 0000000..a34d08f --- /dev/null +++ b/uniapp/uni_modules/uni-scss/styles/setting/_text.scss @@ -0,0 +1,24 @@ +@mixin get-styles($k,$c) { + @if $k == size or $k == weight{ + font-#{$k}:#{$c} + }@else{ + #{$k}:#{$c} + } +} + +@each $key, $child in $uni-headings { + /* #ifndef APP-NVUE */ + .uni-#{$key} { + @each $k, $c in $child { + @include get-styles($k,$c) + } + } + /* #endif */ + /* #ifdef APP-NVUE */ + .container .uni-#{$key} { + @each $k, $c in $child { + @include get-styles($k,$c) + } + } + /* #endif */ +} diff --git a/uniapp/uni_modules/uni-scss/styles/setting/_variables.scss b/uniapp/uni_modules/uni-scss/styles/setting/_variables.scss new file mode 100644 index 0000000..557d3d7 --- /dev/null +++ b/uniapp/uni_modules/uni-scss/styles/setting/_variables.scss @@ -0,0 +1,146 @@ +// @use "sass:math"; +@import '../tools/functions.scss'; +// 闂磋窛鍩虹鍊嶆暟 +$uni-space-root: 2 !default; +// 杈规鍗婂緞榛樿鍊� +$uni-radius-root:5px !default; +$uni-radius: () !default; +// 杈规鍗婂緞鏂偣 +$uni-radius: map-deep-merge( + ( + 0: 0, + // TODO 褰撳墠鐗堟湰鏆傛椂涓嶆敮鎸� sm 灞炴�� + // 'sm': math.div($uni-radius-root, 2), + null: $uni-radius-root, + 'lg': $uni-radius-root * 2, + 'xl': $uni-radius-root * 6, + 'pill': 9999px, + 'circle': 50% + ), + $uni-radius +); +// 瀛椾綋瀹舵棌 +$body-font-family: 'Roboto', sans-serif !default; +// 鏂囨湰 +$heading-font-family: $body-font-family !default; +$uni-headings: () !default; +$letterSpacing: -0.01562em; +$uni-headings: map-deep-merge( + ( + 'h1': ( + size: 32px, + weight: 300, + line-height: 50px, + // letter-spacing:-0.01562em + ), + 'h2': ( + size: 28px, + weight: 300, + line-height: 40px, + // letter-spacing: -0.00833em + ), + 'h3': ( + size: 24px, + weight: 400, + line-height: 32px, + // letter-spacing: normal + ), + 'h4': ( + size: 20px, + weight: 400, + line-height: 30px, + // letter-spacing: 0.00735em + ), + 'h5': ( + size: 16px, + weight: 400, + line-height: 24px, + // letter-spacing: normal + ), + 'h6': ( + size: 14px, + weight: 500, + line-height: 18px, + // letter-spacing: 0.0125em + ), + 'subtitle': ( + size: 12px, + weight: 400, + line-height: 20px, + // letter-spacing: 0.00937em + ), + 'body': ( + font-size: 14px, + font-weight: 400, + line-height: 22px, + // letter-spacing: 0.03125em + ), + 'caption': ( + 'size': 12px, + 'weight': 400, + 'line-height': 20px, + // 'letter-spacing': 0.03333em, + // 'text-transform': false + ) + ), + $uni-headings +); + + + +// 涓昏壊 +$uni-primary: #2979ff !default; +$uni-primary-disable:lighten($uni-primary,20%) !default; +$uni-primary-light: lighten($uni-primary,25%) !default; + +// 杈呭姪鑹� +// 闄や簡涓昏壊澶栫殑鍦烘櫙鑹诧紝闇�瑕佸湪涓嶅悓鐨勫満鏅腑浣跨敤锛堜緥濡傚嵄闄╄壊琛ㄧず鍗遍櫓鐨勬搷浣滐級銆� +$uni-success: #18bc37 !default; +$uni-success-disable:lighten($uni-success,20%) !default; +$uni-success-light: lighten($uni-success,25%) !default; + +$uni-warning: #f3a73f !default; +$uni-warning-disable:lighten($uni-warning,20%) !default; +$uni-warning-light: lighten($uni-warning,25%) !default; + +$uni-error: #e43d33 !default; +$uni-error-disable:lighten($uni-error,20%) !default; +$uni-error-light: lighten($uni-error,25%) !default; + +$uni-info: #8f939c !default; +$uni-info-disable:lighten($uni-info,20%) !default; +$uni-info-light: lighten($uni-info,25%) !default; + +// 涓�ц壊 +// 涓�ц壊鐢ㄤ簬鏂囨湰銆佽儗鏅拰杈规棰滆壊銆傞�氳繃杩愮敤涓嶅悓鐨勪腑鎬ц壊锛屾潵琛ㄧ幇灞傛缁撴瀯銆� +$uni-main-color: #3a3a3a !default; // 涓昏鏂囧瓧 +$uni-base-color: #6a6a6a !default; // 甯歌鏂囧瓧 +$uni-secondary-color: #909399 !default; // 娆¤鏂囧瓧 +$uni-extra-color: #c7c7c7 !default; // 杈呭姪璇存槑 + +// 杈规棰滆壊 +$uni-border-1: #F0F0F0 !default; +$uni-border-2: #EDEDED !default; +$uni-border-3: #DCDCDC !default; +$uni-border-4: #B9B9B9 !default; + +// 甯歌鑹� +$uni-black: #000000 !default; +$uni-white: #ffffff !default; +$uni-transparent: rgba($color: #000000, $alpha: 0) !default; + +// 鑳屾櫙鑹� +$uni-bg-color: #f7f7f7 !default; + +/* 姘村钩闂磋窛 */ +$uni-spacing-sm: 8px !default; +$uni-spacing-base: 15px !default; +$uni-spacing-lg: 30px !default; + +// 闃村奖 +$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default; +$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default; +$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default; + +// 钂欑増 +$uni-mask: rgba($color: #000000, $alpha: 0.4) !default; diff --git a/uniapp/uni_modules/uni-scss/styles/tools/functions.scss b/uniapp/uni_modules/uni-scss/styles/tools/functions.scss new file mode 100644 index 0000000..ac6f63e --- /dev/null +++ b/uniapp/uni_modules/uni-scss/styles/tools/functions.scss @@ -0,0 +1,19 @@ +// 鍚堝苟 map +@function map-deep-merge($parent-map, $child-map){ + $result: $parent-map; + @each $key, $child in $child-map { + $parent-has-key: map-has-key($result, $key); + $parent-value: map-get($result, $key); + $parent-type: type-of($parent-value); + $child-type: type-of($child); + $parent-is-map: $parent-type == map; + $child-is-map: $child-type == map; + + @if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){ + $result: map-merge($result, ( $key: $child )); + }@else { + $result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) )); + } + } + @return $result; +}; diff --git a/uniapp/uni_modules/uni-scss/theme.scss b/uniapp/uni_modules/uni-scss/theme.scss new file mode 100644 index 0000000..80ee62f --- /dev/null +++ b/uniapp/uni_modules/uni-scss/theme.scss @@ -0,0 +1,31 @@ +// 闂磋窛鍩虹鍊嶆暟 +$uni-space-root: 2; +// 杈规鍗婂緞榛樿鍊� +$uni-radius-root:5px; +// 涓昏壊 +$uni-primary: #2979ff; +// 杈呭姪鑹� +$uni-success: #4cd964; +// 璀﹀憡鑹� +$uni-warning: #f0ad4e; +// 閿欒鑹� +$uni-error: #dd524d; +// 鎻忚堪鑹� +$uni-info: #909399; +// 涓�ц壊 +$uni-main-color: #303133; +$uni-base-color: #606266; +$uni-secondary-color: #909399; +$uni-extra-color: #C0C4CC; +// 鑳屾櫙鑹� +$uni-bg-color: #f5f5f5; +// 杈规棰滆壊 +$uni-border-1: #DCDFE6; +$uni-border-2: #E4E7ED; +$uni-border-3: #EBEEF5; +$uni-border-4: #F2F6FC; + +// 甯歌鑹� +$uni-black: #000000; +$uni-white: #ffffff; +$uni-transparent: rgba($color: #000000, $alpha: 0); diff --git a/uniapp/uni_modules/uni-scss/variables.scss b/uniapp/uni_modules/uni-scss/variables.scss new file mode 100644 index 0000000..1c062d4 --- /dev/null +++ b/uniapp/uni_modules/uni-scss/variables.scss @@ -0,0 +1,62 @@ +@import './styles/setting/_variables.scss'; +// 闂磋窛鍩虹鍊嶆暟 +$uni-space-root: 2; +// 杈规鍗婂緞榛樿鍊� +$uni-radius-root:5px; + +// 涓昏壊 +$uni-primary: #2979ff; +$uni-primary-disable:mix(#fff,$uni-primary,50%); +$uni-primary-light: mix(#fff,$uni-primary,80%); + +// 杈呭姪鑹� +// 闄や簡涓昏壊澶栫殑鍦烘櫙鑹诧紝闇�瑕佸湪涓嶅悓鐨勫満鏅腑浣跨敤锛堜緥濡傚嵄闄╄壊琛ㄧず鍗遍櫓鐨勬搷浣滐級銆� +$uni-success: #18bc37; +$uni-success-disable:mix(#fff,$uni-success,50%); +$uni-success-light: mix(#fff,$uni-success,80%); + +$uni-warning: #f3a73f; +$uni-warning-disable:mix(#fff,$uni-warning,50%); +$uni-warning-light: mix(#fff,$uni-warning,80%); + +$uni-error: #e43d33; +$uni-error-disable:mix(#fff,$uni-error,50%); +$uni-error-light: mix(#fff,$uni-error,80%); + +$uni-info: #8f939c; +$uni-info-disable:mix(#fff,$uni-info,50%); +$uni-info-light: mix(#fff,$uni-info,80%); + +// 涓�ц壊 +// 涓�ц壊鐢ㄤ簬鏂囨湰銆佽儗鏅拰杈规棰滆壊銆傞�氳繃杩愮敤涓嶅悓鐨勪腑鎬ц壊锛屾潵琛ㄧ幇灞傛缁撴瀯銆� +$uni-main-color: #3a3a3a; // 涓昏鏂囧瓧 +$uni-base-color: #6a6a6a; // 甯歌鏂囧瓧 +$uni-secondary-color: #909399; // 娆¤鏂囧瓧 +$uni-extra-color: #c7c7c7; // 杈呭姪璇存槑 + +// 杈规棰滆壊 +$uni-border-1: #F0F0F0; +$uni-border-2: #EDEDED; +$uni-border-3: #DCDCDC; +$uni-border-4: #B9B9B9; + +// 甯歌鑹� +$uni-black: #000000; +$uni-white: #ffffff; +$uni-transparent: rgba($color: #000000, $alpha: 0); + +// 鑳屾櫙鑹� +$uni-bg-color: #f7f7f7; + +/* 姘村钩闂磋窛 */ +$uni-spacing-sm: 8px; +$uni-spacing-base: 15px; +$uni-spacing-lg: 30px; + +// 闃村奖 +$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5); +$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2); +$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5); + +// 钂欑増 +$uni-mask: rgba($color: #000000, $alpha: 0.4); diff --git a/uniapp/uni_modules/uni-transition/changelog.md b/uniapp/uni_modules/uni-transition/changelog.md new file mode 100644 index 0000000..70c1cd4 --- /dev/null +++ b/uniapp/uni_modules/uni-transition/changelog.md @@ -0,0 +1,22 @@ +## 1.3.2锛�2023-05-04锛� +- 淇 NVUE 骞冲彴鎶ラ敊鐨勯棶棰� +## 1.3.1锛�2021-11-23锛� +- 淇 init 鏂规硶鍒濆鍖栭棶棰� +## 1.3.0锛�2021-11-19锛� +- 浼樺寲 缁勪欢UI锛屽苟鎻愪緵璁捐璧勬簮锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 鏂囨。杩佺Щ锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/uni-transition](https://uniapp.dcloud.io/component/uniui/uni-transition) +## 1.2.1锛�2021-09-27锛� +- 淇 init 鏂规硶涓嶇敓鏁堢殑 Bug +## 1.2.0锛�2021-07-30锛� +- 缁勪欢鍏煎 vue3锛屽浣曞垱寤� vue3 椤圭洰锛岃瑙� [uni-app 椤圭洰鏀寔 vue3 浠嬬粛](https://ask.dcloud.net.cn/article/37834) +## 1.1.1锛�2021-05-12锛� +- 鏂板 绀轰緥鍦板潃 +- 淇 绀轰緥椤圭洰缂哄皯缁勪欢鐨� Bug +## 1.1.0锛�2021-04-22锛� +- 鏂板 閫氳繃鏂规硶鑷畾涔夊姩鐢� +- 鏂板 custom-class 闈� NVUE 骞冲彴鏀寔鑷畾涔� class 瀹氬埗鏍峰紡 +- 浼樺寲 鍔ㄧ敾瑙﹀彂閫昏緫锛屼娇鍔ㄧ敾鏇存祦鐣� +- 浼樺寲 鏀寔鍗曠嫭鐨勫姩鐢荤被鍨� +- 浼樺寲 鏂囨。绀轰緥 +## 1.0.2锛�2021-02-05锛� +- 璋冩暣涓� uni_modules 鐩綍瑙勮寖 diff --git a/uniapp/uni_modules/uni-transition/components/uni-transition/createAnimation.js b/uniapp/uni_modules/uni-transition/components/uni-transition/createAnimation.js new file mode 100644 index 0000000..8f89b18 --- /dev/null +++ b/uniapp/uni_modules/uni-transition/components/uni-transition/createAnimation.js @@ -0,0 +1,131 @@ +// const defaultOption = { +// duration: 300, +// timingFunction: 'linear', +// delay: 0, +// transformOrigin: '50% 50% 0' +// } +// #ifdef APP-NVUE +const nvueAnimation = uni.requireNativePlugin('animation') +// #endif +class MPAnimation { + constructor(options, _this) { + this.options = options + // 鍦╥OS10+QQ灏忕▼搴忓钩鍙颁笅锛屼紶缁欏師鐢熺殑瀵硅薄涓�瀹氭槸涓櫘閫氬璞¤�屼笉鏄疨roxy瀵硅薄锛屽惁鍒欎細鎶arameter should be Object instead of ProxyObject鐨勯敊璇� + this.animation = uni.createAnimation({ + ...options + }) + this.currentStepAnimates = {} + this.next = 0 + this.$ = _this + + } + + _nvuePushAnimates(type, args) { + let aniObj = this.currentStepAnimates[this.next] + let styles = {} + if (!aniObj) { + styles = { + styles: {}, + config: {} + } + } else { + styles = aniObj + } + if (animateTypes1.includes(type)) { + if (!styles.styles.transform) { + styles.styles.transform = '' + } + let unit = '' + if(type === 'rotate'){ + unit = 'deg' + } + styles.styles.transform += `${type}(${args+unit}) ` + } else { + styles.styles[type] = `${args}` + } + this.currentStepAnimates[this.next] = styles + } + _animateRun(styles = {}, config = {}) { + let ref = this.$.$refs['ani'].ref + if (!ref) return + return new Promise((resolve, reject) => { + nvueAnimation.transition(ref, { + styles, + ...config + }, res => { + resolve() + }) + }) + } + + _nvueNextAnimate(animates, step = 0, fn) { + let obj = animates[step] + if (obj) { + let { + styles, + config + } = obj + this._animateRun(styles, config).then(() => { + step += 1 + this._nvueNextAnimate(animates, step, fn) + }) + } else { + this.currentStepAnimates = {} + typeof fn === 'function' && fn() + this.isEnd = true + } + } + + step(config = {}) { + // #ifndef APP-NVUE + this.animation.step(config) + // #endif + // #ifdef APP-NVUE + this.currentStepAnimates[this.next].config = Object.assign({}, this.options, config) + this.currentStepAnimates[this.next].styles.transformOrigin = this.currentStepAnimates[this.next].config.transformOrigin + this.next++ + // #endif + return this + } + + run(fn) { + // #ifndef APP-NVUE + this.$.animationData = this.animation.export() + this.$.timer = setTimeout(() => { + typeof fn === 'function' && fn() + }, this.$.durationTime) + // #endif + // #ifdef APP-NVUE + this.isEnd = false + let ref = this.$.$refs['ani'] && this.$.$refs['ani'].ref + if(!ref) return + this._nvueNextAnimate(this.currentStepAnimates, 0, fn) + this.next = 0 + // #endif + } +} + + +const animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d', + 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY', + 'translateZ' +] +const animateTypes2 = ['opacity', 'backgroundColor'] +const animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'] +animateTypes1.concat(animateTypes2, animateTypes3).forEach(type => { + MPAnimation.prototype[type] = function(...args) { + // #ifndef APP-NVUE + this.animation[type](...args) + // #endif + // #ifdef APP-NVUE + this._nvuePushAnimates(type, args) + // #endif + return this + } +}) + +export function createAnimation(option, _this) { + if(!_this) return + clearTimeout(_this.timer) + return new MPAnimation(option, _this) +} diff --git a/uniapp/uni_modules/uni-transition/components/uni-transition/uni-transition.vue b/uniapp/uni_modules/uni-transition/components/uni-transition/uni-transition.vue new file mode 100644 index 0000000..bfbba93 --- /dev/null +++ b/uniapp/uni_modules/uni-transition/components/uni-transition/uni-transition.vue @@ -0,0 +1,286 @@ +<template> + <!-- #ifndef APP-NVUE --> + <view v-show="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view> + <!-- #endif --> + <!-- #ifdef APP-NVUE --> + <view v-if="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view> + <!-- #endif --> +</template> + +<script> +import { createAnimation } from './createAnimation' + +/** + * Transition 杩囨浮鍔ㄧ敾 + * @description 绠�鍗曡繃娓″姩鐢荤粍浠� + * @tutorial https://ext.dcloud.net.cn/plugin?id=985 + * @property {Boolean} show = [false|true] 鎺у埗缁勪欢鏄剧ず鎴栭殣钘� + * @property {Array|String} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 杩囨浮鍔ㄧ敾绫诲瀷 + * @value fade 娓愰殣娓愬嚭杩囨浮 + * @value slide-top 鐢变笂鑷充笅杩囨浮 + * @value slide-right 鐢卞彸鑷冲乏杩囨浮 + * @value slide-bottom 鐢变笅鑷充笂杩囨浮 + * @value slide-left 鐢卞乏鑷冲彸杩囨浮 + * @value zoom-in 鐢卞皬鍒板ぇ杩囨浮 + * @value zoom-out 鐢卞ぇ鍒板皬杩囨浮 + * @property {Number} duration 杩囨浮鍔ㄧ敾鎸佺画鏃堕棿 + * @property {Object} styles 缁勪欢鏍峰紡锛屽悓 css 鏍峰紡锛屾敞鎰忓甫鈥�-鈥樿繛鎺ョ鐨勫睘鎬ч渶瑕佷娇鐢ㄥ皬椹煎嘲鍐欐硶濡傦細`backgroundColor:red` + */ +export default { + name: 'uniTransition', + emits:['click','change'], + props: { + show: { + type: Boolean, + default: false + }, + modeClass: { + type: [Array, String], + default() { + return 'fade' + } + }, + duration: { + type: Number, + default: 300 + }, + styles: { + type: Object, + default() { + return {} + } + }, + customClass:{ + type: String, + default: '' + }, + onceRender:{ + type:Boolean, + default:false + }, + }, + data() { + return { + isShow: false, + transform: '', + opacity: 1, + animationData: {}, + durationTime: 300, + config: {} + } + }, + watch: { + show: { + handler(newVal) { + if (newVal) { + this.open() + } else { + // 閬垮厤涓婃潵灏辨墽琛� close,瀵艰嚧鍔ㄧ敾閿欎贡 + if (this.isShow) { + this.close() + } + } + }, + immediate: true + } + }, + computed: { + // 鐢熸垚鏍峰紡鏁版嵁 + stylesObject() { + let styles = { + ...this.styles, + 'transition-duration': this.duration / 1000 + 's' + } + let transform = '' + for (let i in styles) { + let line = this.toLine(i) + transform += line + ':' + styles[i] + ';' + } + return transform + }, + // 鍒濆鍖栧姩鐢绘潯浠� + transformStyles() { + return 'transform:' + this.transform + ';' + 'opacity:' + this.opacity + ';' + this.stylesObject + } + }, + created() { + // 鍔ㄧ敾榛樿閰嶇疆 + this.config = { + duration: this.duration, + timingFunction: 'ease', + transformOrigin: '50% 50%', + delay: 0 + } + this.durationTime = this.duration + }, + methods: { + /** + * ref 瑙﹀彂 鍒濆鍖栧姩鐢� + */ + init(obj = {}) { + if (obj.duration) { + this.durationTime = obj.duration + } + this.animation = createAnimation(Object.assign(this.config, obj),this) + }, + /** + * 鐐瑰嚮缁勪欢瑙﹀彂鍥炶皟 + */ + onClick() { + this.$emit('click', { + detail: this.isShow + }) + }, + /** + * ref 瑙﹀彂 鍔ㄧ敾鍒嗙粍 + * @param {Object} obj + */ + step(obj, config = {}) { + if (!this.animation) return + for (let i in obj) { + try { + if(typeof obj[i] === 'object'){ + this.animation[i](...obj[i]) + }else{ + this.animation[i](obj[i]) + } + } catch (e) { + console.error(`鏂规硶 ${i} 涓嶅瓨鍦╜) + } + } + this.animation.step(config) + return this + }, + /** + * ref 瑙﹀彂 鎵ц鍔ㄧ敾 + */ + run(fn) { + if (!this.animation) return + this.animation.run(fn) + }, + // 寮�濮嬭繃搴﹀姩鐢� + open() { + clearTimeout(this.timer) + this.transform = '' + this.isShow = true + let { opacity, transform } = this.styleInit(false) + if (typeof opacity !== 'undefined') { + this.opacity = opacity + } + this.transform = transform + // 纭繚鍔ㄦ�佹牱寮忓凡缁忕敓鏁堝悗锛屾墽琛屽姩鐢伙紝濡傛灉涓嶅姞 nextTick 锛屼細瀵艰嚧 wx 鍔ㄧ敾鎵ц寮傚父 + this.$nextTick(() => { + // TODO 瀹氭椂鍣ㄤ繚璇佸姩鐢诲畬鍏ㄦ墽琛岋紝鐩墠鏈変簺闂锛屽悗闈細鍙栨秷瀹氭椂鍣� + this.timer = setTimeout(() => { + this.animation = createAnimation(this.config, this) + this.tranfromInit(false).step() + this.animation.run() + this.$emit('change', { + detail: this.isShow + }) + }, 20) + }) + }, + // 鍏抽棴杩囧害鍔ㄧ敾 + close(type) { + if (!this.animation) return + this.tranfromInit(true) + .step() + .run(() => { + this.isShow = false + this.animationData = null + this.animation = null + let { opacity, transform } = this.styleInit(false) + this.opacity = opacity || 1 + this.transform = transform + this.$emit('change', { + detail: this.isShow + }) + }) + }, + // 澶勭悊鍔ㄧ敾寮�濮嬪墠鐨勯粯璁ゆ牱寮� + styleInit(type) { + let styles = { + transform: '' + } + let buildStyle = (type, mode) => { + if (mode === 'fade') { + styles.opacity = this.animationType(type)[mode] + } else { + styles.transform += this.animationType(type)[mode] + ' ' + } + } + if (typeof this.modeClass === 'string') { + buildStyle(type, this.modeClass) + } else { + this.modeClass.forEach(mode => { + buildStyle(type, mode) + }) + } + return styles + }, + // 澶勭悊鍐呯疆缁勫悎鍔ㄧ敾 + tranfromInit(type) { + let buildTranfrom = (type, mode) => { + let aniNum = null + if (mode === 'fade') { + aniNum = type ? 0 : 1 + } else { + aniNum = type ? '-100%' : '0' + if (mode === 'zoom-in') { + aniNum = type ? 0.8 : 1 + } + if (mode === 'zoom-out') { + aniNum = type ? 1.2 : 1 + } + if (mode === 'slide-right') { + aniNum = type ? '100%' : '0' + } + if (mode === 'slide-bottom') { + aniNum = type ? '100%' : '0' + } + } + this.animation[this.animationMode()[mode]](aniNum) + } + if (typeof this.modeClass === 'string') { + buildTranfrom(type, this.modeClass) + } else { + this.modeClass.forEach(mode => { + buildTranfrom(type, mode) + }) + } + + return this.animation + }, + animationType(type) { + return { + fade: type ? 1 : 0, + 'slide-top': `translateY(${type ? '0' : '-100%'})`, + 'slide-right': `translateX(${type ? '0' : '100%'})`, + 'slide-bottom': `translateY(${type ? '0' : '100%'})`, + 'slide-left': `translateX(${type ? '0' : '-100%'})`, + 'zoom-in': `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`, + 'zoom-out': `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})` + } + }, + // 鍐呯疆鍔ㄧ敾绫诲瀷涓庡疄闄呭姩鐢诲搴斿瓧鍏� + animationMode() { + return { + fade: 'opacity', + 'slide-top': 'translateY', + 'slide-right': 'translateX', + 'slide-bottom': 'translateY', + 'slide-left': 'translateX', + 'zoom-in': 'scale', + 'zoom-out': 'scale' + } + }, + // 椹煎嘲杞腑妯嚎 + toLine(name) { + return name.replace(/([A-Z])/g, '-$1').toLowerCase() + } + } +} +</script> + +<style></style> diff --git a/uniapp/uni_modules/uni-transition/package.json b/uniapp/uni_modules/uni-transition/package.json new file mode 100644 index 0000000..ea995a2 --- /dev/null +++ b/uniapp/uni_modules/uni-transition/package.json @@ -0,0 +1,84 @@ +{ + "id": "uni-transition", + "displayName": "uni-transition 杩囨浮鍔ㄧ敾", + "version": "1.3.2", + "description": "鍏冪礌鐨勭畝鍗曡繃娓″姩鐢�", + "keywords": [ + "uni-ui", + "uniui", + "鍔ㄧ敾", + "杩囨浮", + "杩囨浮鍔ㄧ敾" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, +"dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "鏃�", + "data": "鏃�", + "permissions": "鏃�" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": ["uni-scss"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "寰俊娴忚鍣�(Android)": "y", + "QQ娴忚鍣�(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "灏忕▼搴�": { + "寰俊": "y", + "闃块噷": "y", + "鐧惧害": "y", + "瀛楄妭璺冲姩": "y", + "QQ": "y" + }, + "蹇簲鐢�": { + "鍗庝负": "u", + "鑱旂洘": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uniapp/uni_modules/uni-transition/readme.md b/uniapp/uni_modules/uni-transition/readme.md new file mode 100644 index 0000000..2f8a77e --- /dev/null +++ b/uniapp/uni_modules/uni-transition/readme.md @@ -0,0 +1,11 @@ + + +## Transition 杩囨浮鍔ㄧ敾 +> **缁勪欢鍚嶏細uni-transition** +> 浠g爜鍧楋細 `uTransition` + + +鍏冪礌杩囨浮鍔ㄧ敾 + +### [鏌ョ湅鏂囨。](https://uniapp.dcloud.io/component/uniui/uni-transition) +#### 濡備娇鐢ㄨ繃绋嬩腑鏈変换浣曢棶棰橈紝鎴栬�呮偍瀵箄ni-ui鏈変竴浜涘ソ鐨勫缓璁紝娆㈣繋鍔犲叆 uni-ui 浜ゆ祦缇わ細871950839 \ No newline at end of file diff --git a/uniapp/utils/getClipboard.js b/uniapp/utils/getClipboard.js index 3c3a248..8af8f3f 100644 --- a/uniapp/utils/getClipboard.js +++ b/uniapp/utils/getClipboard.js @@ -2,10 +2,9 @@ import request from './http.js' import utils from './utils.js' import clipboard from "../js_sdk/dc-clipboard/clipboard.js" - - + function getclick(callback) { - + //鑾峰彇鍓创鏉垮唴瀹� uni.getClipboardData({ success: res => { console.log(res, '======================================================'); @@ -18,10 +17,10 @@ var res = e.data; callback(res) }).catch(function (err) { + console.log(err) }) }else{ getApp().globalData.hasMode = false - console.log('鍐呴儴澶嶅埗'); } } }) @@ -31,7 +30,7 @@ function updatePopup(dataInfo) { var data = dataInfo.goods; // 寮圭獥閬僵灞� - let maskLayers = new plus.nativeObj.View("maskLayers", { //鍏堝垱寤洪伄缃╁眰 + var maskLayers = new plus.nativeObj.View("maskLayers", { //鍏堝垱寤洪伄缃╁眰 top: '0px', left: '0px', height: '100%', @@ -50,13 +49,13 @@ const viewContentWidth = parseInt(popupViewWidth - viewContentPadding * 2); // 鏄剧ず寮圭獥 maskLayers.show(); - + try{ if (data.goodsId) { let sLeft = 0; let popupViewHeight = popupViewWidth + uni.upx2px(390); sLeft = (data.originalPrice.toString().length + 1) * uni.upx2px(30); // 寮圭獥鍐呭 - var clipViews = new plus.nativeObj.View("clipViews", { //鍒涘缓搴曢儴鍥炬爣鑿滃崟 + let clipViews = new plus.nativeObj.View("clipViews", { //鍒涘缓搴曢儴鍥炬爣鑿滃崟 tag: "rect", top: (screenHeight - popupViewHeight) / 2 + "px", left: (screenWidth - popupViewWidth) / 2 + "px", @@ -297,7 +296,7 @@ }) }else{ uni.navigateTo({ - url: '/pages/goods/goodsDetail?info=' + encodeURIComponent(JSON.stringify(data)) + url: '/pages/goods/goodsDetail?proform=clipboard&info=' + encodeURIComponent(JSON.stringify(data)) }) } getApp().globalData.hasMode = false @@ -744,6 +743,12 @@ getApp().globalData.hasMode = false } }); + } + catch(e) + { + console.log(e); + maskLayers.hide(); + } } export default () => { diff --git a/uniapp/utils/http.api.js b/uniapp/utils/http.api.js index 6680331..083441c 100644 --- a/uniapp/utils/http.api.js +++ b/uniapp/utils/http.api.js @@ -100,6 +100,10 @@ let changeCodeUrl="/api/user/changecode"; let getRecomInviterUrl="/api/user/getRecomInviter"; let updateFirstFreeBrowseUrl="/api/user/update_first_free_browse"; +let updateCidUrl="/api/user/UpdateClientId"; +let checkPreferenceGoodsUrl="/api/user/check_preference_goods"; +let gussessLikeGoodsUrl="/api/taoke/gussess_like_goods"; + // 姝ゅ绗簩涓弬鏁皏m锛屽氨鏄垜浠湪椤甸潰浣跨敤鐨則his锛屼綘鍙互閫氳繃vm鑾峰彇vuex绛夋搷浣滐紝鏇村鍐呭璇﹁uView瀵规嫤鎴櫒鐨勪粙缁嶉儴鍒嗭細 // https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F @@ -206,10 +210,12 @@ let changeCode=(params = {}) => vm.$u.post(changeCodeUrl, params); //淇敼閭�璇风爜 let getRecomInviter=(params = {}) => vm.$u.post(getRecomInviterUrl, params); //鑾峰彇鎺ㄨ崘閭�璇蜂汉 let updateFirstFreeBrowse=(params = {}) => vm.$u.post(updateFirstFreeBrowseUrl, params); //璁板綍0鍏冭喘 - + let updateCid=(params={})=>vm.$u.post(updateCidUrl,params);//鏇存柊pushcid + let checkPreferenceGoods=(params={})=>vm.$u.post(checkPreferenceGoodsUrl,params);//妫�娴嬫槸鍚︽湁鍋忓ソ鍟嗗搧 + let gussessLikeGoods=(params={})=>vm.$u.post(gussessLikeGoodsUrl,params);//棣栭〉鐚滀綘鍠滄 // 灏嗗悇涓畾涔夌殑鎺ュ彛鍚嶇О锛岀粺涓�鏀捐繘瀵硅薄鎸傝浇鍒皏m.$u.api(鍥犱负vm灏辨槸this锛屼篃鍗硉his.$u.api)涓� - vm.$u.api = {updateFirstFreeBrowse,getRecomInviter,changeCode,getHdkCategoryList,eleStoreList,getPrivilegeShareLink,getDyGoodsDetail,bindMobileLogin,getTopMessId,changePwd,comminInt,wxapplogin,getTopCalss,getBanner,getHomeMenu,getSuperClass,getMQD,getGoodThing,login,sendSms,mobileLogin,setPwd,getUserInfo,getTalentInfo,getMessageList,getGoodsDetail,getPrivilegeLink,getSimilerGoods,getJdsDetail,getPddDetail,getM,getWphGoodsDetail,addCollect,delCollect,hotKey,suggestion,goodsSearch,activityLink,unionAct,singlePageLink,checkPddAuth,getPddAuth,getPineGoods,jdGoodsList,optimusMaterial,pddGoodsList,brandList,brandInfo,wphGoodsList,meituanAct,eleAct,eleShangjin,userHomemenu,getAppVersion,userBrowse,delBrowse,activitySingle,userCollect,bdHomemenu,getCity,coordinate,cityCate,searchDeals,getCityId,seckillShowinfo,seckillList,identifyGoods,changeMobile,bindInvitation,getInviteInfo,getEstimateAmount,fansList,getFansCount,getHelpType,getHelpList,getHelpDetail,getWpanurl,getChainTurning,superDiscountGoods,getHistory,getTbGoodsList,cateRankList,getUpgradeInfo,getEquityCard,levelApply,orderList,userProfit,bindZfb,withdraw,getBalanceLog,getPublisher,getAlbum,likeAlbum,albumDetail,anchorFollow,myFollowAlbum,feedback,userCancel,profile,bindWechat,unboundWechat}; + vm.$u.api = {gussessLikeGoods,checkPreferenceGoods,updateCid,updateFirstFreeBrowse,getRecomInviter,changeCode,getHdkCategoryList,eleStoreList,getPrivilegeShareLink,getDyGoodsDetail,bindMobileLogin,getTopMessId,changePwd,comminInt,wxapplogin,getTopCalss,getBanner,getHomeMenu,getSuperClass,getMQD,getGoodThing,login,sendSms,mobileLogin,setPwd,getUserInfo,getTalentInfo,getMessageList,getGoodsDetail,getPrivilegeLink,getSimilerGoods,getJdsDetail,getPddDetail,getM,getWphGoodsDetail,addCollect,delCollect,hotKey,suggestion,goodsSearch,activityLink,unionAct,singlePageLink,checkPddAuth,getPddAuth,getPineGoods,jdGoodsList,optimusMaterial,pddGoodsList,brandList,brandInfo,wphGoodsList,meituanAct,eleAct,eleShangjin,userHomemenu,getAppVersion,userBrowse,delBrowse,activitySingle,userCollect,bdHomemenu,getCity,coordinate,cityCate,searchDeals,getCityId,seckillShowinfo,seckillList,identifyGoods,changeMobile,bindInvitation,getInviteInfo,getEstimateAmount,fansList,getFansCount,getHelpType,getHelpList,getHelpDetail,getWpanurl,getChainTurning,superDiscountGoods,getHistory,getTbGoodsList,cateRankList,getUpgradeInfo,getEquityCard,levelApply,orderList,userProfit,bindZfb,withdraw,getBalanceLog,getPublisher,getAlbum,likeAlbum,albumDetail,anchorFollow,myFollowAlbum,feedback,userCancel,profile,bindWechat,unboundWechat}; } export default { diff --git a/uniapp/utils/utils.js b/uniapp/utils/utils.js index 3839885..3909262 100644 --- a/uniapp/utils/utils.js +++ b/uniapp/utils/utils.js @@ -213,6 +213,29 @@ }) } } + else if(info.url_type == 15) + {//璺宠浆娣樺疂椤甸潰 + let tburl = info.parameter_json.url == undefined ? '' : info.parameter_json.url; + console.log(tburl) + if(tburl == '') return false; + // #ifdef APP-PLUS + if (plus.runtime.isApplicationExist({ + pname: 'com.taobao.taobao', + action: 'taobao://' + })) { + const plug = uni.requireNativePlugin('xiguazhu-baichuan') + plug.detailPage({ + url: tburl, + "openType": 0 + }, result => { + }); + } else { + uni.navigateTo({ + url:'@/webView/webView?url=' + tburl + }) + } + // #endif + } } else { uni.redirectTo({ -- Gitblit v1.9.3