Przeglądaj źródła

添加私域二维码

xiaoxin 9 miesięcy temu
rodzic
commit
6eae4d5524
1 zmienionych plików z 28 dodań i 23 usunięć
  1. 28 23
      pages/my/index.vue

+ 28 - 23
pages/my/index.vue

@@ -9,13 +9,14 @@
 				<view class="u-flex-1 u-m-l-10 flex justify-between align-center" v-if="!isLogin">
 					<view class="u-font-18 text-bold">
 						<!-- #ifdef  MP-WEIXIN -->
-						<view class="margin-left-sm margin-top-xs" style="width: 180px">{{ shopName }}</view>
+						<view class="margin-left-sm margin-top-xs" style="width: 220rpx">{{ shopName }}</view>
 						<!-- #endif -->
 						<!-- #ifndef MP-WEIXIN -->
-						<view class="margin-left-sm margin-top-xs" style="width: 180px">{{ shopName }}</view>
+						<view class="margin-left-sm margin-top-xs" style="width: 220rpx">{{ shopName }}</view>
 						<!-- #endif -->
 					</view>
 					<view class="erweima" @click="shopQr()">二维码</view>
+					<view class="erweima" @click="shopQrSphere()">私域二维码</view>
 				</view>
 				<view v-else class="text-xl u-p-l-20 text-bold" @click="goLogin('/pages/my/loginphone')">登录</view>
 			</view>
@@ -198,9 +199,17 @@
 				<image src="../../static/images/my/right.png" class="images" mode=""></image>
 			</view> -->
 		</view>
-		<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="500rpx" :closeable="closeable">
+		<!-- 二维码弹窗 -->
+		<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="500rpx" closeable>
 			<view style="width: 180px; height: 180px; margin: 40px auto">
-				<image :src="shopQrImg" style="width: 100%; height: 100%" @click="previewImage"></image>
+				<image :src="shopQrImg" style="width: 100%; height: 100%" @click="previewImage(shopQrImg)"></image>
+			</view>
+		</u-popup>
+
+		<!-- 私域二维码弹窗 -->
+		<u-popup v-model="showSphere" mode="center" border-radius="14" width="500rpx" height="500rpx" closeable>
+			<view style="width: 180px; height: 180px; margin: 40px auto">
+				<image :src="shopQrImgSphere" style="width: 100%; height: 100%" @click="previewImage(shopQrImgSphere)"></image>
 			</view>
 		</u-popup>
 	</view>
@@ -323,8 +332,9 @@ export default {
 			XCXIsSelect: '否',
 			isCashDeposit: '',
 			show: false,
+			showSphere: false,
 			shopQrImg: '',
-			closeable: true,
+			shopQrImgSphere: '',
 			open: true,
 			arr: [],
 			messageCount: '',
@@ -489,9 +499,9 @@ export default {
 				}
 			})
 		},
-		previewImage() {
-			var arr = []
-			arr.push(this.shopQrImg)
+		previewImage(img) {
+			let arr = []
+			arr.push(img)
 			//uniapp预览轮播图方法
 			uni.previewImage({
 				current: 0, //预览图片的下标
@@ -512,19 +522,19 @@ export default {
 			// 	icon: 'none'
 			// });
 			this.show = true
-			// var data={
-			// 	shopId:uni.getStorageSync('shopId')
-			// }
-			// this.$Request.get("/invite/shopQr",data).then(res => {
-			// 	if (res.code == 0) {
-			// 		console.log(res,'oooo')
-			// 		this.checked = res.data.isSendMsg == null || res.data.isSendMsg == 1 ? true : false
-			// 	}
-			// });
-			var shopid = urlSafeBase64Encode(encrypt(uni.getStorageSync('shopId').toString()))
+
+			let shopid = urlSafeBase64Encode(encrypt(uni.getStorageSync('shopId').toString()))
 			this.shopQrImg = configurl.APIHOSTsss + '/sqx_fast/invite/shopQr?shopId=' + shopid
 			console.log(this.shopQrImg, 'oooo')
 		},
+		//生成私域二维码
+		shopQrSphere() {
+			this.showSphere = true
+
+			let shopid = urlSafeBase64Encode(encrypt(uni.getStorageSync('shopId').toString()))
+			this.shopQrImgSphere = configurl.APIHOSTsss + '/sqx_fast/invite/shopQr2?shopId=' + shopid
+			console.log(this.shopQrImgSphere, 'oooo——Sphere')
+		},
 		//跳转用户端
 		gouser() {
 			wx.navigateToMiniProgram({
@@ -768,11 +778,6 @@ export default {
 				}
 			})
 		},
-		selectShop(e) {
-			this.shop = e
-			this.show = false
-		},
-
 		goNav(url) {
 			if (this.shopToken) {
 				// #ifdef MP-WEIXIN