瀏覽代碼

支付宝小程序兼容性修改

ylong 7 月之前
父節點
當前提交
e813518906

+ 0 - 21
App.vue

@@ -25,27 +25,6 @@ export default {
 		pageContentHeight: 0,
 	},
 	onLaunch(options) {
-		const that = this;
-		// 获取系统信息
-		const systemInfo = uni.getSystemInfoSync();
-		// 胶囊按钮位置信息
-		const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
-		console.log(menuButtonInfo);
-		// 导航栏高度 = 状态栏到胶囊的间距(胶囊距上距离-状态栏高度) * 2 + 胶囊高度 + 状态栏高度
-		that.globalData.menuTop = menuButtonInfo.top - systemInfo.statusBarHeight;
-		that.globalData.menuBotton = menuButtonInfo.top - systemInfo.statusBarHeight;
-		that.globalData.menuWidth = menuButtonInfo.width;
-		that.globalData.navBarHeight =
-			(menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight;
-		that.globalData.menuRight = systemInfo.screenWidth - menuButtonInfo.right;
-		that.globalData.menuHeight = menuButtonInfo.height;
-		that.globalData.statusBarHeight = systemInfo.statusBarHeight;
-		that.globalData.safeAreaHeight = systemInfo.safeAreaInsets.bottom;
-		that.globalData.windowWidth = systemInfo.windowWidth;
-		that.globalData.windowHeight = systemInfo.windowHeight;
-		that.globalData.pageContentHeight =
-			systemInfo.windowHeight -
-			(that.globalData.navBarHeight + that.globalData.menuTop + that.globalData.menuBotton);
 		console.log(options, "onLaunch系统信息");
 		let params = {};
 		if (options.query) {

+ 0 - 181
components/navbar/navbar-search.vue

@@ -1,181 +0,0 @@
-<template>
-	<view class="slot">
-		<view class="toph">
-			<u-search
-				:placeholder="placeholder"
-				:value="value"
-				height="70"
-				@search="searchConfirm"
-				@custom="searchConfirm"
-			></u-search>
-			<view class="goodsSort">
-				<view class="item" :class="{'active':!sortTypes.price_sc && !sortTypes.sales_sc}" @click="changeSort(1)">
-					<text>综合</text>
-				</view>
-				<view class="item" :class="{'active':['asc','desc'].includes(sortTypes.price_sc)}" @click="changeSort(2)">
-					<text>价格</text>
-					<view :class="['sortIcon',sortTypes.price_sc]"></view>
-				</view>
-				<view class="item" :class="{'active':sortTypes.sales_sc=='desc'}" @click="changeSort(3)">
-					<text>销量</text>
-				</view>
-			</view>
-		</view>
-		<view class="siteBar"></view>
-	</view>
-</template>
-
-<script>
-const app = getApp();
-export default {
-	name: 'navbar-search',
-	props: {
-		title: {
-			type: String,
-			default: '搜索'
-		},
-		value: {
-			type: String,
-			default: ''
-		},
-		// 占位内容
-		placeholder: {
-			type: String,
-			default: '请输入'
-		},
-	},
-	data() {
-		return {
-			// 导航栏高度
-			navBarHeight: app.globalData.navBarHeight,
-			statusBarHeight: app.globalData.statusBarHeight,
-			menuRight: app.globalData.menuRight,
-			menuBotton: app.globalData.menuBotton,
-			menuHeight: app.globalData.menuHeight,
-			menuTop: app.globalData.menuTop,
-			menuWidth: app.globalData.menuWidth,
-			// 背景色
-			searchBgColor: this.$appTheme.appThemeSearchBgColor,
-			// 排序类型
-			sortTypes:{
-				price_sc:'',//desc 降序,asc升序
-				sales_sc:'',//desc 降序,asc升序
-			},
-			/* // priceSort: [{
-			// 		label: '默认排序',
-			// 		value: 1,
-			// 	},
-			// 	{
-			// 		label: '距离优先',
-			// 		value: 2,
-			// 	},
-			// 	{
-			// 		label: '价格优先',
-			// 		value: 3,
-			// 	}
-			// ],
-			// saleSort: [{
-			// 		label: '去冰',
-			// 		value: 1,
-			// 	},
-			// 	{
-			// 		label: '加冰',
-			// 		value: 2,
-			// 	},
-			// ], */
-		};
-	},
-	
-
-	methods: {		
-		// 搜索
-		searchConfirm(e) {
-			this.$emit('confirm', e);
-		},
-		changeSort(e){
-			switch (e){
-				case 1:
-					// 综合
-					this.sortTypes = {
-						price_sc:'',
-						sales_sc:'',
-					}
-					break;
-				case 2:
-					// 价格
-					this.sortTypes.price_sc = this.sortTypes.price_sc=='desc'?'asc':'desc';
-					this.sortTypes.sales_sc = '';
-					break;
-				case 3:
-				// 销量
-					this.sortTypes.sales_sc = 'desc';
-					this.sortTypes.price_sc = '';
-					break;
-				default:
-					break;
-			}
-			// this.sortType = e;
-			this.$emit('sortType', this.sortTypes);
-		}
-	}
-};
-</script>
-
-<style lang="scss" scoped>
-.siteBar{
-	height: 140rpx;
-}
-.toph {
-	width: 100%;
-	position: fixed;
-	top: 0;
-	left: 0;
-	z-index: 899;
-	overflow: hidden;
-	background-color: $app-theme-bg-color;
-	box-sizing: border-box;
-	padding: 0 30rpx;
-}
-
-.goodsSort{
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	padding: 0 30rpx;
-	height: 80rpx;
-	box-sizing: content-box;
-	border-bottom: 1rpx solid $app-theme-border-color;
-	.item{
-		position: relative;
-		text-align: center;
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		color: $app-theme-text-gray-color;
-		text{
-			font-size: 30rpx;
-		}
-		.sortIcon{
-			width: 18rpx;
-			height: 30rpx;
-			background-image: url('../../static/icon/sort.png');
-			background-position: 0 0;
-			background-size: auto 100%;
-			margin-left: 10rpx;
-			&.asc{
-				background-position: 42rpx 0;
-			}
-			&.desc{
-				background-position:20rpx 0;
-			}
-		}
-		&.active{
-			color: $app-theme-color;
-		}
-		&.priceAsc{
-			
-		}
-	}
-}
-
-</style>

+ 0 - 228
components/navbar/navbar-tab-search.vue

@@ -1,228 +0,0 @@
-<template>
-	<view class="slot">
-		<view class="slot-inner" :style="[showSearch ? { minHeight: navBarHeight + 'px' } : { height: navBarHeight + 'px' }]">
-			<view
-				v-if="showSearch"
-				class="inner-showSearch"
-				:style="[
-					{ minHeight: menuHeight + 'px' },
-					{ lineHeight: menuHeight + 'px' },
-					{ paddingLeft: menuRight * 2 + 'px' },
-					{ paddingRight: menuRight * 2 + 'px' },
-					{ paddingTop: navBarHeight - menuHeight - menuTop + 'px' },
-					{ paddingBottom: '20rpx' }
-				]"
-			>
-				<view class="page_title"
-					:style="[
-						{ minHeight: menuHeight + 'px' },
-						{ lineHeight: menuHeight + 'px' },
-					]"
-				>
-					{{pageTitle}}
-				</view>
-				<view class="search-slot" :style="{ paddingTop: '16px' }">
-					<!-- shape="square" 
-						borderRadius="0rpx"-->
-					<u-search
-						class="search-components"
-						@click="goSearchPage(url)"
-						disabled
-						:placeholder="placeholder"
-						:showAction="false"
-						:bg-color="searchBgColor"
-						:class="showSlot ? 'active' : ''"
-					></u-search>
-					<slot showSlot></slot>
-				</view>
-			</view>
-			<view class="inner" v-else>
-				<view
-					@click="$u.route({ type: 'navigateBack', delta: 1 })"
-					class="left"
-					v-if="showBack"
-					:style="[{ minHeight: menuHeight + 'px' }, { lineHeight: menuHeight + 'px' }, { left: menuRight * 2 + 'px' }, { bottom: menuBotton + 'px' }]"
-				>
-					<u-icon size="32" name="arrow-leftward"></u-icon>
-				</view>
-				<view class="page_title"
-					:style="[
-						{ minHeight: menuHeight + 'px' },
-						{ lineHeight: menuHeight + 'px' },
-					]"
-				>
-				<!-- { left: showBack ? menuRight * 2 + 40 + 'px' : menuRight * 2 + 'px' },
-					{ bottom: menuBotton + 'px' } -->
-					{{pageTitle}}
-				</view>
-			</view>
-		</view>
-		<!--  + 27 -->
-		<view class="slot-height" v-if="showSearch" :style="[{ height: navBarHeight + menuHeight+statusBarHeight + 'px' }]"></view>
-		<view class="slot-height" v-else :style="[{ height: navBarHeight + 'px' }]"></view>
-	</view>
-</template>
-
-<script>
-const app = getApp();
-export default {
-	name: 'navbar-tab-search',
-	props: {
-		// 配置项
-		tabOps: {
-			type: Array,
-			default: () => {
-				return ['tab1', 'tab2'];
-			}
-		},
-		pageTitle:{
-			type: String,
-			default: '书嗨',
-		},
-		// 占位内容
-		placeholder: {
-			type: String,
-			default: '请输入'
-		},
-		// 是否显示插槽,用于输入框右侧内容的显示
-		showSlot: {
-			type: Boolean,
-			default: false
-		},
-		// 是否显示搜索框
-		showSearch: {
-			type: Boolean,
-			default: false
-		},
-		// 跳转的url
-		url: {
-			type: String,
-			default: ''
-		},
-		// 是否显示返回按钮
-		showBack: {
-			type: Boolean,
-			default: false
-		}
-	},
-	data() {
-		return {
-			// 导航栏高度
-			navBarHeight: app.globalData.navBarHeight,
-			statusBarHeight: app.globalData.statusBarHeight,
-			menuRight: app.globalData.menuRight,
-			menuBotton: app.globalData.menuBotton,
-			menuHeight: app.globalData.menuHeight,
-			menuTop: app.globalData.menuTop,
-			// 当前tab
-			current: 0,
-			// 背景色
-			searchBgColor: this.$appTheme.appThemeSearchBgColor
-		};
-	},
-	
-	methods: {
-		// 切换tab
-		change(index) {
-			this.current = index;
-			this.$emit('change', index);
-		},
-
-		// 去搜索页面
-		goSearchPage(url) {
-			uni.navigateTo({
-				url
-			});
-		}
-	}
-};
-</script>
-
-<style lang="scss" scoped>
-	.page_title{
-		text-align: center;
-		font-size: 32rpx;
-	}
-.slot {
-	width: 100vw;
-}
-.slot-inner {
-	width: 100%;
-	position: fixed;
-	top: 0;
-	left: 0;
-	z-index: 899;
-	overflow: hidden;
-}
-/* .tabList {
-	display: flex;
-	align-items: center;
-	.tab {
-		font-size: 36rpx;
-		font-weight: 400;
-		margin-right: 48rpx;
-		color: $app-theme-navbar-tab-color;
-		&.active {
-			font-weight: 500;
-			color: $app-theme-navbar-tab-color-active;
-			font-size: 40rpx;
-			position: relative;
-			&::before {
-				content: '';
-				width: 16rpx;
-				height: 6rpx;
-				background: $app-theme-navbar-tab-color-active;
-				border-radius: 1px;
-				position: absolute;
-				bottom: -10rpx;
-				left: 50%;
-				transform: translate(-50%, 0);
-			}
-		}
-	}
-}
- */
-.inner {
-	width: 100%;
-	position: relative;
-	height: 100%;
-	background-color: $app-theme-bg-color;
-	.left {
-		position: absolute;
-		z-index: 999;
-		display: flex;
-		align-items: center;
-		// 防误触
-		width: 30x;
-		margin-right: 10px;
-	}
-	/* .tabList {
-		width: 50%;
-		position: absolute;
-		z-index: 999;
-		display: flex;
-		align-items: center;
-	} */
-}
-.inner-showSearch {
-	width: 100%;
-	height: 100%;
-	background-color: $app-theme-bg-color;
-	.tabList {
-		display: flex;
-		align-items: center;
-	}
-}
-.search-slot {
-	width: 100%;
-	display: flex;
-	justify-content: space-between;
-	align-items: center;
-	.search-components {
-		width: 100%;
-		&.active {
-			width: 86%;
-		}
-	}
-}
-</style>

+ 0 - 176
components/navbar/navbar-top-search.vue

@@ -1,176 +0,0 @@
-<template>
-	<view class="slot">
-		<view class="searchbox">
-			<u-search
-				class="search-components"
-				@click="goSearchPage(url)"
-				disabled
-				height="70"
-				:placeholder="placeholder"
-				:showAction="false"
-				:bg-color="searchBgColor"
-				:class="showSlot ? 'active' : ''"
-			></u-search>
-			<slot showSlot></slot>
-		</view>
-		<view class="siteBar"></view>
-	</view>
-</template>
-
-<script>
-const app = getApp();
-export default {
-	name: 'navbar-tab-search',
-	props: {
-		pageTitle:{
-			type: String,
-			default: '书嗨',
-		},
-		// 占位内容
-		placeholder: {
-			type: String,
-			default: '请输入'
-		},
-		// 是否显示插槽,用于输入框右侧内容的显示
-		showSlot: {
-			type: Boolean,
-			default: false
-		},
-		// 跳转的url
-		url: {
-			type: String,
-			default: ''
-		},
-		// 是否显示返回按钮
-		showBack: {
-			type: Boolean,
-			default: false
-		}
-	},
-	data() {
-		return {
-			// 导航栏高度
-			navBarHeight: app.globalData.navBarHeight,
-			statusBarHeight: app.globalData.statusBarHeight,
-			menuRight: app.globalData.menuRight,
-			menuBotton: app.globalData.menuBotton,
-			menuHeight: app.globalData.menuHeight,
-			menuTop: app.globalData.menuTop,
-			// 当前tab
-			current: 0,
-			// 背景色
-			searchBgColor: this.$appTheme.appThemeSearchBgColor
-		};
-	},
-	
-	methods: {
-		// 切换tab
-		change(index) {
-			this.current = index;
-			this.$emit('change', index);
-		},
-
-		// 去搜索页面
-		goSearchPage(url) {
-			uni.navigateTo({
-				url
-			});
-		}
-	}
-};
-</script>
-
-<style lang="scss" scoped>
-.siteBar {
-	height: 90rpx;
-}
-.slot-inner {
-	width: 100%;
-	position: fixed;
-	top: 0;
-	left: 0;
-	z-index: 899;
-	overflow: hidden;
-	background-color: #fff;
-}
-/* .tabList {
-	display: flex;
-	align-items: center;
-	.tab {
-		font-size: 36rpx;
-		font-weight: 400;
-		margin-right: 48rpx;
-		color: $app-theme-navbar-tab-color;
-		&.active {
-			font-weight: 500;
-			color: $app-theme-navbar-tab-color-active;
-			font-size: 40rpx;
-			position: relative;
-			&::before {
-				content: '';
-				width: 16rpx;
-				height: 6rpx;
-				background: $app-theme-navbar-tab-color-active;
-				border-radius: 1px;
-				position: absolute;
-				bottom: -10rpx;
-				left: 50%;
-				transform: translate(-50%, 0);
-			}
-		}
-	}
-}
- */
-.inner {
-	width: 100%;
-	position: relative;
-	height: 100%;
-	background-color: $app-theme-bg-color;
-	.left {
-		position: absolute;
-		z-index: 999;
-		display: flex;
-		align-items: center;
-		// 防误触
-		width: 30x;
-		margin-right: 10px;
-	}
-	/* .tabList {
-		width: 50%;
-		position: absolute;
-		z-index: 999;
-		display: flex;
-		align-items: center;
-	} */
-}
-.inner-showSearch {
-	width: 100%;
-	height: 100%;
-	background-color: $app-theme-bg-color;
-	.tabList {
-		display: flex;
-		align-items: center;
-	}
-}
-.searchbox {
-	width: 100%;
-	padding: 0 30rpx 20rpx;
-	box-sizing: border-box;
-	display: flex;
-	justify-content: space-between;
-	align-items: center;
-	position: fixed;
-	top: 0;
-	left: 0;
-	z-index: 899;
-	overflow: hidden;
-	background-color: #fff;
-	.search-components {
-		width: 100%;
-		&.active {
-			// width: 86%;
-			margin-right: 30rpx;
-		}
-	}
-}
-</style>

+ 1 - 1
pages-home/pages/book-order.vue

@@ -3,7 +3,7 @@
         <!-- 取货地址部分 -->
         <view class="section-card">
             <view class="flex-a flex-j-b mb-20" @click="handleAddress" v-if="defaultAddr.id">
-                <image src="../static/adderss.png" style="width: 40rpx; height: 40rpx"></image>
+                <image src="/pages-mine/static/adderss.png" style="width: 40rpx; height: 40rpx"></image>
                 <view class="flex-d flex-1 ml-24" style="margin-right: 90rpx">
                     <view class="flex-a flex-j-b mb-10">
                         <view :style="titleStyle">发货人:{{ defaultAddr.name }}</view>

+ 1 - 1
pages-mine/components/address-card.vue

@@ -11,7 +11,7 @@
 
         <!-- 主要内容区 -->
         <view class="content flex-a" @click="updateAddress">
-            <image src="../static/adderss.png" style="width: 40rpx; height: 40rpx"></image>
+            <image src="/pages-mine/static/adderss.png" style="width: 40rpx; height: 40rpx"></image>
 
             <view class="flex-1 mr-40 ml-24 flex-d">
                 <view class="header flex-a flex-1 mb-24">

+ 7 - 7
pages-mine/components/order-actions.vue

@@ -2,10 +2,10 @@
     <view class="order-container" style="width: 100%;" :class="{ 'large-size': size === 'large' }">
         <view class="order-actions">
             <!-- 未提交 -->
-            <button v-if="status === 0" class="action-btn" @click.stop="handleAction('submit')">提交订单</button>
+            <button v-if="status == 0" class="action-btn" @click.stop="handleAction('submit')">提交订单</button>
 
             <!-- 待初审 -->
-            <template v-if="status === 2">
+            <template v-if="status == 2">
                 <view class="flex-row w-full" style="display: flex;justify-content: space-between;">
                     <button class="action-btn info-btn" @click.stop="handleAction('cancel')">取消订单</button>
                     <view class="flex-row">
@@ -17,11 +17,11 @@
             </template>
 
             <!-- 待取件 -->
-            <button v-if="status === 3 && item.canReport == 1" class="action-btn"
+            <button v-if="status == 3 && item.canReport == 1" class="action-btn"
                 @click.stop="handleAction('report')">一键上报</button>
 
             <!-- 待审核 -->
-            <template v-if="status === 8">
+            <template v-if="status == 8">
                 <button class="action-btn" @click.stop="handleAction('remindAudit')"
                     v-if="item.canNotice == 1">提醒审核</button>
                 <button class="action-btn plain" v-if="item.canComplaints == 1"
@@ -30,10 +30,10 @@
             </template>
 
             <!-- 待到款 -->
-            <button v-if="status === 10" class="action-btn" @click.stop="handleAction('complaint')">订单投诉</button>
+            <button v-if="status == 10" class="action-btn" @click.stop="handleAction('complaint')">订单投诉</button>
 
             <!-- 已完成 -->
-            <template v-if="status === 11">
+            <template v-if="status == 11">
                 <button class="action-btn plain" v-if="item.canComplaints == 1"
                     @click.stop="handleAction('complaint')">订单投诉</button>
                 <button v-if="showCompensation" class="action-btn"
@@ -51,7 +51,7 @@ export default {
     name: 'OrderActions',
     props: {
         status: {
-            type: Number,
+            type: [Number, String],
             required: true
         },
         order: {

+ 4 - 2
pages-mine/pages/apply-return.vue

@@ -67,9 +67,11 @@ export default {
         this.refreshList()
     },
     methods: {
-        refreshList() {
+        refreshList() { 
             this.requestUrl = this.currentTab == 0 ? this.refundUrl : this.canRefundUrl
-            this.$refs.pageRef?.loadData(true)
+            this.$nextTick(() => {
+                this.$refs.pageRef?.loadData(true)
+            })
         },
         handleTabChange(index) {
             this.currentTab = index

+ 1 - 1
pages-mine/pages/apply.vue

@@ -1,7 +1,7 @@
 <template>
     <view class="apply-page">
         <view class="common-card flex-a flex-j-b mb-20" @click="handleAddress" v-if="defaultAddr.id">
-            <image src="../../pages-mine/static/adderss.png" style="width:40rpx;height: 40rpx;"></image>
+            <image src="/pages-mine/static/adderss.png" style="width:40rpx;height: 40rpx;"></image>
             <view class="flex-d flex-1 ml-24" style="margin-right: 90rpx;">
                 <view class="flex-a flex-j-b  mb-10">
                     <view :style="titleStyle">{{ defaultAddr.name }}</view>

+ 6 - 2
pages-mine/pages/order-page.vue

@@ -64,9 +64,10 @@ export default {
         }
     },
     onLoad(options) {
+        console.log(options, 'options')
         // 如果有传入状态,切换到对应tab
         if (options.status) {
-            this.currentTab = this.tabList.findIndex(item => item.status === options.status)
+            this.currentTab = this.tabList.findIndex(item => item.status == options.status)
             this.params.status = options.status
         } else {
             this.currentTab = 0
@@ -84,7 +85,10 @@ export default {
     
     methods: {
         loadOrders(bool = false, params = {}) {
-            this.$refs.pageRef?.loadData(bool, params);
+            console.log(this.$refs.pageRef, 'params')
+            this.$nextTick(() => {
+                this.$refs.pageRef?.loadData(bool, params);
+            })
         },
 
         handleSuccess() {

+ 3 - 1
pages-mine/pages/partner/order-detail.vue

@@ -65,7 +65,9 @@ export default {
     },
     methods: {
         loadOrders(bool = false, params = {}) {
-            this.$refs.pageRef?.loadData(bool, params);
+            this.$nextTick(() => {
+                this.$refs.pageRef?.loadData(bool, params);
+            })
         },
 
         handleTabChange(index) {

+ 5 - 1
pages.json

@@ -145,7 +145,11 @@
                     "path": "pages/partner/partner-rule",
                     "style": {
                         "navigationStyle": "custom",
-                        "navigationBarTitleText": "合伙人计划"
+                        "navigationBarTitleText": "",
+                        "mp-alipay": {
+                            "transparentTitle": "always",
+                            "titlePenetrate": "YES"
+                        }
                     }
                 },
                 {