lhl 4 years ago
parent
commit
1547af5516
5 changed files with 44 additions and 12 deletions
  1. 1 3
      config/app.js
  2. 2 0
      pages.json
  3. 27 4
      pages/goods_details/index.vue
  4. 5 0
      pages/index/index.vue
  5. 9 5
      pages/user/index.vue

+ 1 - 3
config/app.js

@@ -12,10 +12,8 @@ let httpApi = 'https://www.jzwcy.com'
 // let httpApi = ''
 
 
-
-
 // 聊天接口修改此字符 小程序聊天要求wss 例如:wss://mer.crmeb.net
-let wsApi = ''
+let wsApi = 'wss://www.jzwcy.com'
 // let wsApi = 'wss://192.168.31.50:8324'
 
 module.exports = {

+ 2 - 0
pages.json

@@ -765,12 +765,14 @@
 				"selectedIconPath": "./static/images/2-002.png",
 				"text": "分类"
 			},
+			//#ifndef MP-TOUTIAO
 			{
 				"pagePath": "pages/order_addcart/order_addcart",
 				"iconPath": "./static/images/3-001.png",
 				"selectedIconPath": "./static/images/3-002.png",
 				"text": "购物车"
 			},
+			// #endif
 			{
 				"pagePath": "pages/user/index",
 				"iconPath": "./static/images/4-001.png",

+ 27 - 4
pages/goods_details/index.vue

@@ -173,7 +173,7 @@
 			</view>
 			<!-- #endif -->
 			<!-- #ifdef MP-TOUTIAO -->
-			<template v-if="power != ''">
+			<template v-if="power">
 				<navigator open-type="switchTab" class="animated item" :class="animated == true ? 'bounceIn' : ''" url="/pages/order_addcart/order_addcart" hover-class="none">
 					<view class="iconfont icon-gouwuche1">
 						<text v-if="CartCount > 0" class="num bg-color">{{ CartCount || 0 }}</text>
@@ -385,7 +385,10 @@ export default {
 	onLoad(options) {
 		let that = this;
 		// #ifdef APP-PLUS
-		that.ppower = uni.getStorageSync('power')
+		// that.ppower = uni.getStorageSync('power')
+		// #endif
+		// #ifdef MP-TOUTIAO
+		this.getppower()
 		// #endif
 		if (options.spid) {
 			app.globalData.spid = options.spid;
@@ -1350,6 +1353,24 @@ export default {
 				image: url
 			});
 			return res.data.image;
+			
+		},
+		getppower() {
+			getPower().then( ({data}) => {
+				if(data.openlink) {
+					this.ppower = true
+					this.power = data.openlink
+					uni.setStorageSync('power', data.openlink);
+				}else {
+					uni.showModal({
+						title: '提示',
+						showCancel: false,
+						content: '抖音小程序主要为商品展示,不支持加入购物车和购买功能!',
+					})
+				}
+				
+				
+			})
 		},
 		getPower() {
 			let obj = this;
@@ -1367,6 +1388,8 @@ export default {
 				path: curRouter,
 				query: query
 			}).then(({ data }) => {
+				obj.power = data.openlink;
+				console.log(obj.power,'obj.power-befo')
 				if (data.openlink) {
 					uni.showModal({
 						title: '提示',
@@ -1374,12 +1397,12 @@ export default {
 						content: '抖音小程序为商品展示,请点击下方的复制链接,通过微信打开!',
 						confirmText: '复制链接',
 						success: () => {
-							obj.power = data.openlink;
+							console.log(obj.power,'obj.power-after')
 							uni.setClipboardData({
 								data: obj.power,
 								success: function() {
 									console.log('success');
-									return true;
+									// return true;
 								},
 								fail: function() {
 									console.log('err')

+ 5 - 0
pages/index/index.vue

@@ -296,6 +296,7 @@
 				</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">
 						<image src="../../static/img/dhbg.png" mode="" class="dhbg"></image>
@@ -306,6 +307,8 @@
 						</view>
 					</navigator>
 				</view>
+				<!-- #endif -->
+				
 				<!-- 品牌好店 -->
 				<view class="explosion" v-if="brandList.length && hide_mer_status !=1">
 					<view class="common-hd">
@@ -1203,6 +1206,7 @@
 				getPower().then( ({data}) => {
 					if(data.openlink) {
 						this.power = data.openlink
+						console.log(this.power)
 						uni.setStorageSync('power', data.openlink);
 					}else {
 						uni.showModal({
@@ -2378,6 +2382,7 @@
 							.price {
 								font-weight: 700;
 								color: $theme-color;
+								
 							}
 
 							.txt {

+ 9 - 5
pages/user/index.vue

@@ -92,6 +92,7 @@
 				</swiper>
 			</view>
 			<!-- #endif -->
+			<!-- #ifndef MP-TOUTIAO -->
 			<!-- 会员菜单 -->
 			<view class="user-menus" style="margin-top: 20rpx;">
 				<view class="title">我的服务</view>
@@ -111,11 +112,11 @@
 					 	<text>分销推广</text>
 					 </navigator>
 					 <!-- #endif -->
-					<view class="item" @click="goUrl(item.url)"
-					 v-for="(item,index) in MyMenus" :key="index">
-						<image :src="item.pic"></image>
-						<text>{{item.name}}</text>
-					</view>
+					 <view class="item" @click="goUrl(item.url)"
+					  v-for="(item,index) in MyMenus" :key="index">
+					 	<image :src="item.pic"></image>
+					 	<text>{{item.name}}</text>
+					 </view>
 					<navigator url="/pages/admin/order/index" class="item" hover-class="none" v-if="userInfo.service && userInfo.service.customer === 1">
 						<image src="/static/images/user-menu-002.png"></image>
 						<text>订单管理</text>
@@ -140,6 +141,7 @@
 					</view>
 				</view>
 			</view>
+			<!-- #endif -->
 		</view>
 		<view style="height: 50rpx;"></view>
 		<!-- #ifdef MP -->
@@ -406,12 +408,14 @@
 				uni.navigateTo({
 					url: '/pages/users/user_info/index'
 				})
+				
 			},
 			// 签到
 			goSignIn() {
 				uni.navigateTo({
 					url: '/pages/users/user_sgin/index'
 				})
+				
 			},
 			// goMenuPage
 			goMenuPage(url) {