Prechádzať zdrojové kódy

【Mod】修复分享异常的问题

liuxiangxin 5 mesiacov pred
rodič
commit
1796bafe2a

+ 6 - 6
pages/car/index.vue

@@ -7,15 +7,15 @@
 					<image class="checkbox" :src="item.checked?'../../static/icon/checked.png':'../../static/icon/checkbox.png'" ></image>
 				</view>
 				<view class="box_left">
-					<navigator :url="'/pages/product/index.vue?product_id='+item.product_id" >
+					<navigator :url="'/pages/product/index?product_id='+item.product_id" >
 						<image class="car_image" :src="item.thumb" mode=""></image>
 					</navigator>
 				</view>
 				<view class="box_center">
-					<navigator :url="'/pages/product/index.vue?product_id='+item.product_id" class="car_name">{{item.name}}</navigator>
-					<navigator :url="'/pages/product/index.vue?product_id='+item.product_id" class="car_spec">{{item.spec}}</navigator>
+					<navigator :url="'/pages/product/index?product_id='+item.product_id" class="car_name">{{item.name}}</navigator>
+					<navigator :url="'/pages/product/index?product_id='+item.product_id" class="car_spec">{{item.spec}}</navigator>
           <view v-if="item.promo_title" class="promo_title">{{item.promo_title}}</view>
-					<navigator :url="'/pages/product/index.vue?product_id='+item.product_id"  class="car_price">
+					<navigator :url="'/pages/product/index?product_id='+item.product_id"  class="car_price">
 						<text class="price">¥{{item.price}}</text>
 						<text class="market_price">¥{{item.market_price}}</text>
 					</navigator>
@@ -78,12 +78,12 @@
 			// 获取分享信息
 			let shareObj	= {
 								title: '药优惠 得积分 兑豪礼',
-								path: '/pages/index.vue/index.vue',
+								path: '/pages/index/index',
 								imageUrl:'',
 							};
 			// 循环列表
 			for ( let i in shareList ) {
-				if( shareList[i].pages == 'pages/car/index.vue' ) {
+				if( shareList[i].pages == 'pages/car/index' ) {
 					shareObj.path  = shareList[i].path ? shareList[i].path : shareObj.path ;
 					shareObj.title  = shareList[i].title ? shareList[i].title : shareObj.title ;
 					shareObj.imageUrl  = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;

+ 7 - 0
pages/coupon/active.vue

@@ -84,6 +84,13 @@
 		},
 		onLoad(param) {
 			this.requestParam.id = param.id;
+			// 如果有scene参数的话,获取其中的ID
+			if( param.scene )	{
+				// 转键值对参数
+				let scene		= this.$http.strToParam(param.scene);
+				// 如果没有传入ID,但是传入了场景ID,获取场景ID
+				if( !param.id && scene.id )	this.requestParam.id = scene.id;
+			}
 			// #ifdef MP-WEIXIN
 			//分享按钮
 			uni.showShareMenu({

+ 2 - 2
pages/index/index.vue

@@ -88,12 +88,12 @@
 			// 获取分享信息
 			let shareObj	= {
 								title: '药优惠 得积分 兑豪礼',
-								path: '/pages/index.vue/index.vue',
+								path: '/pages/index/index',
 								imageUrl:'',
 							};
 			// 循环列表
 			for ( let i in shareList ) {
-				if( shareList[i].pages == 'pages/index.vue/index.vue' ) {
+				if( shareList[i].pages == 'pages/index/index' ) {
 					shareObj.path  = shareList[i].path ? shareList[i].path : shareObj.path ;
 					shareObj.title  = shareList[i].title ? shareList[i].title : shareObj.title ;
 					shareObj.imageUrl  = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;

+ 7 - 0
pages/orders/lottery.vue

@@ -104,6 +104,13 @@
 		onLoad(param) {
 			// 接收参数
 			this.requestParam.id = param.id;
+			// 如果有scene参数的话,获取其中的ID
+			if( param.scene )	{
+				// 转键值对参数
+				let scene		= this.$http.strToParam(param.scene);
+				// 如果没有传入ID,但是传入了场景ID,获取场景ID
+				if( !param.id && scene.id )	this.requestParam.id = scene.id;
+			}
 			// 窗口信息
 			var sysinfo = uni.getWindowInfo();
 			// 获取屏幕可用高度

+ 1 - 1
pages/orders/receipt.vue

@@ -64,7 +64,7 @@
 				orderInfo:{},
 				shareInfo:{
 					title: "我已经完成一笔订单,你也快来吧",
-					path: '/pages/index.vue/index.vue',
+					path: '/pages/index/index',
 					imageUrl:"",
 				}
 			}

+ 9 - 2
pages/product/index.vue

@@ -314,7 +314,7 @@
 					poster: "",
 					description: "",
 					regiment_title: '',
-          promo_title: '',
+					promo_title: '',
 					automatic_info: {
 						end_time: '',
 					},
@@ -382,6 +382,13 @@
 		onLoad(param) {
 			// 接受路由参数,产品ID
 			this.requestParam.id = param.product_id;
+			// 如果有scene参数的话,获取其中的ID
+			if( param.scene )	{
+				// 转键值对参数
+				let scene		= this.$http.strToParam(param.scene);
+				// 如果没有传入ID,但是传入了场景ID,获取场景ID
+				if( !param.product_id && scene.id )	this.requestParam.id = scene.id;
+			}
 			var that = this;
 			// 监听地址变动
 			uni.$on('addr_list_change', function(data) {
@@ -399,7 +406,7 @@
 		onShareAppMessage(obj) {
 			return {
 				title: this.productInfo.name,
-				path: '/pages/product/index.vue?product_id=' + this.productInfo.id
+				path: '/pages/product/index?product_id=' + this.productInfo.id
 			}
 		},
 		onShow() {

+ 1 - 1
pages/score/clockin.vue

@@ -37,7 +37,7 @@
 						<view class="score_one">
 							<image class="score_icon" src="../../static/icon/score.png" mode=""></image>
 						</view>
-						<!--						<view class="score_tow" v-if="index.vue == 2 ||  index.vue == 4">
+						<!--						<view class="score_tow" v-if="index == 2 ||  index == 4">
 							<image class="score_icon" src="../../static/icon/score.png" mode=""></image>
 							<image class="score_icon" src="../../static/icon/score.png" mode=""></image>
 						</view>-->

+ 2 - 2
pages/score/index.vue

@@ -57,12 +57,12 @@
 			// 获取分享信息
 			let shareObj	= {
 								title: '药优惠 得积分 兑豪礼',
-								path: '/pages/score/index.vue',
+								path: '/pages/score/index',
 								imageUrl:'',
 							};
 			// 循环列表
 			for ( let i in shareList ) {
-				if( shareList[i].pages == 'pages/score/index.vue' ) {
+				if( shareList[i].pages == 'pages/score/index' ) {
 					shareObj.path  = shareList[i].path ? shareList[i].path : shareObj.path ;
 					shareObj.title  = shareList[i].title ? shareList[i].title : shareObj.title ;
 					shareObj.imageUrl  = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;

+ 2 - 2
pages/user/index.vue

@@ -80,12 +80,12 @@
 			let shareObj	= {
 								title: '药优惠 得积分 兑豪礼',
 								//path: '/pages/score/lottery',
-								path: '/pages/user/index.vue',
+								path: '/pages/user/index',
 								imageUrl:'',
 							};
 			// 循环列表
 			for ( let i in shareList ) {
-				if( shareList[i].pages == 'pages/user/index.vue' ) {
+				if( shareList[i].pages == 'pages/user/index' ) {
 					shareObj.path  = shareList[i].path ? shareList[i].path : shareObj.path ;
 					shareObj.title  = shareList[i].title ? shareList[i].title : shareObj.title ;
 					shareObj.imageUrl  = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;

+ 4 - 4
uni_modules/lime-dialer/components/l-dialer/l-dialer.vue

@@ -101,13 +101,13 @@ export default {
 					border: `${this.getStyleOpt.borderColor && '1rpx solid ' + this.getStyleOpt.borderColor }`
 				}
 				if(this.prizeList.length == 2) {
-					style['transform'] = index == 0 ? 0 : `rotate(270deg)` //`rotate(${(360 / this.prizeList.length) * index.vue}deg)`
+					style['transform'] = index == 0 ? 0 : `rotate(270deg)` //`rotate(${(360 / this.prizeList.length) * index}deg)`
 					style['top']  = 0
 				} 
 				return style
 				// return {
-				// 	transform: `rotate(${(360 / this.prizeList.length) * index.vue}deg) skewX(0deg) skewY(${360 / this.prizeList.length - 90}deg)`,
-				// 	backgroundColor: `${this.styleOpt.prizeBgColors[index.vue % this.styleOpt.prizeBgColors.length]}`,
+				// 	transform: `rotate(${(360 / this.prizeList.length) * index}deg) skewX(0deg) skewY(${360 / this.prizeList.length - 90}deg)`,
+				// 	backgroundColor: `${this.styleOpt.prizeBgColors[index % this.styleOpt.prizeBgColors.length]}`,
 				// 	border: `${this.styleOpt.borderColor && '1rpx solid ' + this.styleOpt.borderColor }`
 				// }
 			};
@@ -160,7 +160,7 @@ export default {
 			this.rotateTransition = `transform ${duration}s cubic-bezier(0.250, 0.460, 0.455, 0.995)`;
 			this.isTurnIng = true
 			// sleep(duration * 1000 + 500).then(() => {
-			// 	this.$emit('done', index.vue);
+			// 	this.$emit('done', index);
 			// 	this.isTurnIng = false
 			// })
 			setTimeout(() => {

+ 1 - 1
uni_modules/uni-popup/components/uni-popup/uni-popup.vue

@@ -1,5 +1,5 @@
 <template>
-	<view v-if="showPopup" class="uni-popup" :class="[popupstyle, isDesktop ? 'fixforpc-z-index.vue' : '']">
+	<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" />

+ 11 - 11
utils/decimal.js

@@ -2579,7 +2579,7 @@ function checkRoundingDigits(d, i, rm, repeating) {
 		i %= LOG_BASE;
 	}
 
-	// i is the index.vue (0 - 6) of the rounding digit.
+	// i is the index (0 - 6) of the rounding digit.
 	// E.g. if within the word 3487563 the first rounding digit is 5,
 	// then i = 4, k = 1000, rd = 3487563 % 1000 = 563
 	k = mathpow(10, LOG_BASE - i);
@@ -2962,11 +2962,11 @@ function finalise(x, sd, rm, isTruncated) {
 
 		// rd: the rounding digit, i.e. the digit after the digit that may be rounded up.
 		// w: the word of xd containing rd, a base 1e7 number.
-		// xdi: the index.vue of w within xd.
+		// xdi: the index of w within xd.
 		// digits: the number of digits of w.
-		// i: what would be the index.vue of rd within w if all the numbers were 7 digits long (i.e. if
+		// i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if
 		// they had leading zeros)
-		// j: if > 0, the actual index.vue of rd within w (if < 0, rd is a leading zero).
+		// j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).
 
 		// Get the length of the first word of the digits array xd.
 		for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;
@@ -2978,7 +2978,7 @@ function finalise(x, sd, rm, isTruncated) {
 			j = sd;
 			w = xd[xdi = 0];
 
-			// Get the rounding digit at index.vue j of w.
+			// Get the rounding digit at index j of w.
 			rd = w / mathpow(10, digits - j - 1) % 10 | 0;
 		} else {
 			xdi = Math.ceil((i + 1) / LOG_BASE);
@@ -3001,14 +3001,14 @@ function finalise(x, sd, rm, isTruncated) {
 				// Get the number of digits of w.
 				for (digits = 1; k >= 10; k /= 10) digits++;
 
-				// Get the index.vue of rd within w.
+				// Get the index of rd within w.
 				i %= LOG_BASE;
 
-				// Get the index.vue of rd within w, adjusted for leading zeros.
+				// Get the index of rd within w, adjusted for leading zeros.
 				// The number of leading zeros of w is given by LOG_BASE - digits.
 				j = i - LOG_BASE + digits;
 
-				// Get the rounding digit at index.vue j of w.
+				// Get the rounding digit at index j of w.
 				rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;
 			}
 		}
@@ -3018,7 +3018,7 @@ function finalise(x, sd, rm, isTruncated) {
 			xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));
 
 		// The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right
-		// of the digit at (left-to-right) index.vue j, e.g. if w is 908714 and j is 2, the expression
+		// of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression
 		// will give 714.
 
 		roundUp = rm < 4 ?
@@ -3358,7 +3358,7 @@ function naturalExponential(x, sd) {
 			// If so, repeat the summation with a higher precision, otherwise
 			// e.g. with precision: 18, rounding: 1
 			// exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)
-			// `wpr - guard` is the index.vue of first rounding digit.
+			// `wpr - guard` is the index of first rounding digit.
 			if (sd == null) {
 
 				if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
@@ -3488,7 +3488,7 @@ function naturalLogarithm(y, sd) {
 			// If so, restart the summation with a higher precision, otherwise
 			// e.g. with precision: 12, rounding: 1
 			// ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.
-			// `wpr - guard` is the index.vue of first rounding digit.
+			// `wpr - guard` is the index of first rounding digit.
 			if (sd == null) {
 				if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
 					Ctor.precision = wpr += guard;

+ 15 - 1
utils/request.js

@@ -87,7 +87,21 @@ const fileupload = (url, filePath,data = {}) =>{
 	})
 }
 
+// 字符串键值对转参数对象
+const strToParam = (str, separator = '&')=> {
+	// 先转码
+	str			= decodeURIComponent(str);
+	let pairs 	= str.split(separator);
+	let result 	= {};
+	pairs.forEach(pair => {
+		let [key, value] = pair.split('=');
+		result[key] = value;
+	});
+	// 返回结果
+	return result;
+}
+
 // 模块导出,{name:object} 为对象式,导出多个使用
 // export default {request:request,request1:request1};
 // 单个对象,直接导出如下
-export default {request:request,fileupload:fileupload}
+export default {request:request,fileupload:fileupload,strToParam:strToParam}