2312970463@qq.com 4 年之前
父节点
当前提交
515f35720c

+ 2 - 2
api/api.js

@@ -216,6 +216,6 @@ export function getCity() {
 // export function getLiveList(page,limit) {
 //   return request.get('wechat/live', { page, limit}, { noAuth: true });
 // }
-export function getPower() {
-	return request.post('scheme', { }, { noAuth: true });
+export function getPower(data) {
+	return request.post('scheme', data, { noAuth: true });
 }

+ 16 - 3
components/recommend/index.vue

@@ -19,7 +19,12 @@
 					</view>
 					
 					<view class="acea-row row-middle">
-						<view class='money font-color'>¥<text class='num'>{{item.price}}</text></view>
+						<!-- #ifdef MP-TOUTIAO -->
+						<view class='money font-color' v-if="power">¥<text class='num'>{{item.price}}</text></view>
+						<!-- #endif -->
+						<!-- #ifndef MP-TOUTIAO -->
+						<view class='money font-color' >¥<text class='num'>{{item.price}}</text></view>
+						<!-- #endif -->
 						<text class="coupon font-color-red" v-if="item.issetCoupon">领券</text>
 					</view>
 				</view>
@@ -54,10 +59,18 @@
 		},
 		data() {
 			return {
-
+				// #ifdef MP-TOUTIAO
+				power: '',
+				// #endif
+				
 			};
 		},
-
+		onLoad() {
+			// #ifdef MP-TOUTIAO
+			this.power = uni.getStorageSync('power')
+			// #endif
+			
+		},
 		methods: {
 			goDetail(item){
 				goShopDetail(item, this.uid).then(res => {

+ 58 - 0
pages/activity/combination_details/index.vue

@@ -261,6 +261,9 @@
 	import {
 		getconfig,
 	} from '@/api/public.js';
+	import {
+		getPower
+	} from '@/api/api.js';
 	import {
 		getProductCode,
 		collectAdd,
@@ -946,7 +949,12 @@
 					this.$set(this, 'isShowAuth', true)
 					// #endif
 				} else {
+					// #ifdef MP-TOUTIAO
+					this.getPower()
+					// #endif
+					// #ifndef MP-TOUTIAO
 					this.goCat();
+					// #endif
 				}
 			},
 			/*
@@ -1044,7 +1052,12 @@
 					this.$set(this, 'isShowAuth', true);
 					// #endif
 				} else {
+					// #ifdef MP-TOUTIAO
+					this.getPower()
+					// #endif
+					// #ifndef MP-TOUTIAO
 					this.goCat(true);
+					// #endif
 				}
 			},
 			// 授权关闭
@@ -1268,6 +1281,51 @@
 					});
 				})
 			},
+			getPower() {
+				let obj = this;
+				let routes = getCurrentPages();
+				let curRouter = routes[routes.length - 1].route;
+				let curParam = routes[routes.length - 1].options;
+				let query = '';
+				for (let item in curParam) {
+					let str = curParam[item];
+					query += item + '=' + str + '&';
+				}
+				query = query.replace(/&$/,'')
+				console.log(query,'66666666666666')
+				getPower({
+					path: curRouter,
+					query: query
+				}).then(({ data }) => {
+					if (data.openlink) {
+						uni.showModal({
+							title: '提示',
+							showCancel: false,
+							content: '抖音小程序为商品展示,请点击下方的复制链接,通过微信打开!',
+							confirmText: '复制链接',
+							success: () => {
+								obj.power = data.openlink;
+								uni.setClipboardData({
+									data: obj.power,
+									success: function() {
+										console.log('success');
+										return true;
+									},
+									fail: function() {
+										console.log('err')
+									}
+								});
+							}
+						});
+					} else {
+						uni.showModal({
+							title: '提示',
+							showCancel: false,
+							content: '抖音小程序主要为商品展示,不支持加入购物车和购买功能!'
+						});
+					}
+				});
+			},
 		},
 	}
 </script>

+ 58 - 1
pages/activity/goods_seckill_details/index.vue

@@ -222,7 +222,8 @@
 	} from '@/api/user.js';
 	import {
 		getCoupons,
-		getShopCoupons
+		getShopCoupons,
+		getPower
 	} from '@/api/api.js';
 	import {
 		getCartCounts
@@ -886,7 +887,13 @@
 					this.$set(this, 'isShowAuth', true)
 					// #endif
 				} else {
+					// #ifdef MP-TOUTIAO
+					this.getPower()
+					// #endif
+					// #ifndef MP-TOUTIAO
 					this.goCat();
+					// #endif
+					
 				}
 			},
 			/*
@@ -980,7 +987,12 @@
 					this.$set(this, 'isShowAuth', true);
 					// #endif
 				} else {
+					// #ifdef MP-TOUTIAO
+					this.getPower()
+					// #endif
+					// #ifndef MP-TOUTIAO
 					this.goCat(true);
+					// #endif	
 				}
 			},
 			// 授权关闭
@@ -1205,6 +1217,51 @@
 				}
 			},
 			//#endif
+			getPower() {
+				let obj = this;
+				let routes = getCurrentPages();
+				let curRouter = routes[routes.length - 1].route;
+				let curParam = routes[routes.length - 1].options;
+				let query = '';
+				for (let item in curParam) {
+					let str = curParam[item];
+					query += item + '=' + str + '&';
+				}
+				query = query.replace(/&$/,'')
+				console.log(query,'66666666666666')
+				getPower({
+					path: curRouter,
+					query: query
+				}).then(({ data }) => {
+					if (data.openlink) {
+						uni.showModal({
+							title: '提示',
+							showCancel: false,
+							content: '抖音小程序为商品展示,请点击下方的复制链接,通过微信打开!',
+							confirmText: '复制链接',
+							success: () => {
+								obj.power = data.openlink;
+								uni.setClipboardData({
+									data: obj.power,
+									success: function() {
+										console.log('success');
+										return true;
+									},
+									fail: function() {
+										console.log('err')
+									}
+								});
+							}
+						});
+					} else {
+						uni.showModal({
+							title: '提示',
+							showCancel: false,
+							content: '抖音小程序主要为商品展示,不支持加入购物车和购买功能!'
+						});
+					}
+				});
+			}
 		},
 	}
 </script>

+ 57 - 1
pages/activity/presell_details/index.vue

@@ -249,7 +249,8 @@
 	} from '@/api/user.js';
 	import {
 		getCoupons,
-		getShopCoupons
+		getShopCoupons,
+		getPower
 	} from '@/api/api.js';
 	import {
 		getCartCounts
@@ -1061,7 +1062,12 @@
 					this.$set(this, 'isShowAuth', true)
 					// #endif
 				} else {
+					// #ifdef MP-TOUTIAO
+					this.getPower()
+					// #endif
+					// #ifndef MP-TOUTIAO
 					this.goCat();
+					// #endif
 				}
 			},
 			/*
@@ -1159,7 +1165,12 @@
 					this.$set(this, 'isShowAuth', true);
 					// #endif
 				} else {
+					// #ifdef MP-TOUTIAO
+					this.getPower()
+					// #endif
+					// #ifndef MP-TOUTIAO
 					this.goCat(true);
+					// #endif
 				}
 			},
 			// 授权关闭
@@ -1386,6 +1397,51 @@
 					});
 				})
 			},
+			getPower() {
+				let obj = this;
+				let routes = getCurrentPages();
+				let curRouter = routes[routes.length - 1].route;
+				let curParam = routes[routes.length - 1].options;
+				let query = '';
+				for (let item in curParam) {
+					let str = curParam[item];
+					query += item + '=' + str + '&';
+				}
+				query = query.replace(/&$/,'')
+				console.log(query,'66666666666666')
+				getPower({
+					path: curRouter,
+					query: query
+				}).then(({ data }) => {
+					if (data.openlink) {
+						uni.showModal({
+							title: '提示',
+							showCancel: false,
+							content: '抖音小程序为商品展示,请点击下方的复制链接,通过微信打开!',
+							confirmText: '复制链接',
+							success: () => {
+								obj.power = data.openlink;
+								uni.setClipboardData({
+									data: obj.power,
+									success: function() {
+										console.log('success');
+										return true;
+									},
+									fail: function() {
+										console.log('err')
+									}
+								});
+							}
+						});
+					} else {
+						uni.showModal({
+							title: '提示',
+							showCancel: false,
+							content: '抖音小程序主要为商品展示,不支持加入购物车和购买功能!'
+						});
+					}
+				});
+			}
 		},
 	}
 </script>

文件差异内容过多而无法显示
+ 543 - 533
pages/goods_details/index.vue


+ 20 - 0
pages/index/index.vue

@@ -279,6 +279,18 @@
 			</view>
 			<view class="main">
 				<!-- 热点菜单 -->
+				<!-- #ifdef MP-TOUTIAO -->
+				<view class="hot-img" style="margin-top:20rpx" v-if="power">
+					<navigator :url="item.url" class="item" v-for="(item,index) in hot" :key="index" hover-class="none">
+						<view class="title area-row">{{item.title}}</view>
+						<view class="msg area-row" :style="'color:'+item.color+';'">{{item.s_title}}</view>
+						<view class="img">
+							<image :src="item.pic" mode=""></image>
+						</view>
+					</navigator>
+				</view>
+				<!-- #endif -->
+				<!-- #ifndef MP-TOUTIAO -->
 				<view class="hot-img" style="margin-top:20rpx">
 					<navigator :url="item.url" class="item" v-for="(item,index) in hot" :key="index" hover-class="none">
 						<view class="title area-row">{{item.title}}</view>
@@ -288,6 +300,7 @@
 						</view>
 					</navigator>
 				</view>
+				<!-- #endif -->
 				<!-- 品牌好店 -->
 				<view class="explosion" v-if="brandList.length && hide_mer_status !=1">
 					<view class="common-hd">
@@ -307,9 +320,16 @@
 								<navigator :url="`/pages/goods_details/index?id=${itemn.product_id}`" hover-class="none" class="pro-item" v-for="(itemn,indexn) in item.recommend"
 								 :key='indexn' v-if="item.recommend.length<=3">
 									<image :src="itemn.image" mode=""></image>
+									<!-- #ifdef MP-TOUTIAO -->
+									<view class="price" v-if="power">
+										<text>¥</text>{{itemn.price}}
+									</view>
+									<!-- #endif -->
+									<!-- #ifndef MP-TOUTIAO -->
 									<view class="price">
 										<text>¥</text>{{itemn.price}}
 									</view>
+									<!-- #endif -->
 								</navigator>
 							</view>
 						</view>

+ 0 - 13
pages/order_addcart/order_addcart.vue

@@ -327,19 +327,6 @@
 			},
 			// 立即下单
 			subOrder: function(event) {
-				// #ifdef MP-TOUTIAO
-				let power = uni.getStorageSync('power')
-				console.log(power,'22222222222222222222')
-				if(!power) {
-					console.log('ddddddddddddddddd')
-					uni.showModal({
-						title: '提示',
-						showCancel: false,
-						content: '抖音小程序主要为商品展示,不支持加入购物车和购买功能!',
-					})
-					return
-				}
-				// #endif
 				let selectValue = []
 				this.cartList.valid.forEach(el=>{
 					el.list.forEach(goods=>{

+ 5 - 3
pages/users/user_address/index.vue

@@ -34,11 +34,13 @@
 				</view>
 
 				<button class='keepBnt bg-color' form-type="submit">立即保存</button>
-				<!-- #ifdef MP -->
-				<view class="wechatAddress" v-if="!id" @click="getWxAddress">导入微信地址</view>
+				<!-- #ifdef MP -->
+				<!-- #ifdef MP-WEIXIN -->
+				<view class="wechatAddress" v-if="!id" @click="getWxAddress">导入地址</view>
+				<!-- #endif -->
 				<!-- #endif -->
 				<!-- #ifdef H5 -->
-				<view class="wechatAddress" v-if="this.$wechat.isWeixin() && !id" @click="getAddress">导入微信地址</view>
+				<view class="wechatAddress" v-if="this.$wechat.isWeixin() && !id" @click="getAddress">导入地址</view>
 				<!-- #endif -->
 			</view>
 		</form>

部分文件因为文件数量过多而无法显示