lhl 1 рік тому
батько
коміт
930bf8610b
4 змінених файлів з 31 додано та 93 видалено
  1. 8 8
      pages.json
  2. 2 2
      pages/index/index.vue
  3. 2 22
      pages/product/product.vue
  4. 19 61
      pages/user/shareQrCode.vue

+ 8 - 8
pages.json

@@ -5,7 +5,7 @@
 				// #ifndef MP-WEIXIN
 				"navigationStyle": "custom",
 				// #endif
-				"navigationBarTitleText": ""
+				"navigationBarTitleText": "宏根蒂"
 			}
 		},
 		{
@@ -378,7 +378,7 @@
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "uni-app",
+		"navigationBarTitleText": "宏根蒂",
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"backgroundColor": "#f8f8f8"
 	},
@@ -399,12 +399,12 @@
 				"selectedIconPath": "static/tabBar/cate-action.png",
 				"text": "分类"
 			},
-			{
-				"pagePath": "pages/cart/cart",
-				"iconPath": "static/tabBar/cart.png",
-				"selectedIconPath": "static/tabBar/cart-action.png",
-				"text": "购物车"
-			},
+			// {
+			// 	"pagePath": "pages/cart/cart",
+			// 	"iconPath": "static/tabBar/cart.png",
+			// 	"selectedIconPath": "static/tabBar/cart-action.png",
+			// 	"text": "购物车"
+			// },
 			{
 				"pagePath": "pages/user/user",
 				"iconPath": "static/tabBar/user.png",

+ 2 - 2
pages/index/index.vue

@@ -65,10 +65,10 @@
 		<view class="jg">
 
 		</view>
-		<view class="hdlist" >
+		<!-- <view class="hdlist" >
 			<image src="../../static/index/ryc.png" @click="navto('/pages/index/actionDetail?id=1',1)" mode="widthFix"></image>
 			<image src="../../static/index/xny.png" @click="navto('/pages/index/actionDetail?id=2',1)" mode="widthFix"></image>
-		</view>
+		</view> -->
 		<!-- 商品列表 start -->
 		<view class="product-box">
 			<view class="product-tit flex">

+ 2 - 22
pages/product/product.vue

@@ -53,36 +53,22 @@
 					<text class="selected-text">{{ goodsObjact.num + goodsObjact.unit_name }}</text>
 				</view>
 			</view>
-			<!-- <view class="c-row b-b" v-if="goodsObjact.is_integral == 1 && goodsType == 0">
-				<text class="tit">积分</text>
-				<view class="bz-list con">
-					<text>最高抵扣¥{{ moneyNum(goodsObjact.use_max_integral) == 0 ? moneyNum(goodsObjact.price) : moneyNum(goodsObjact.use_max_integral) }}</text>
-				</view>
-			</view> -->
 		</view>
-		<!-- 评价 -->
-		<!-- <estimate @navTo="navTo('/pages/product/reply?id=' + goodsid)" v-if="reply" :reply="reply" :list="details"></estimate> -->
 		<view class="detail-desc">
 			<view class="d-header"><text>商品详情</text></view>
 			<rich-text class="detail-centent" :nodes="goodsObjact.description"></rich-text>
 			<view :class="{ contentBottomHeight: goodsType == 1 || goodsType == 2, goodsBottom: goodsType == 0 }"></view>
 		</view>
 		<!-- 底部操作菜单 -->
-		<view class="page-bottom" v-if="goodsType == 0">
+		<!-- <view class="page-bottom" v-if="goodsType == 0">
 			<view class="action-btn-group">
-				<!-- <view class="shoucang flex" @click="toFavorite(goodsObjact)">
-					<image src="../../static/icon/sc-ico.png" mode=""></image>
-					<view class="">
-						收藏
-					</view>
-				</view> -->
 				<view class="buy-now">
 					<button type="primary" class=" action-btn no-border buy-now-btn" @click.stop="toggleSpec(2)" v-if="is_bk == 0 && is_xf ==0">加入购物车</button>
 					<button type="primary" class=" action-btn no-border  add-cart-btn" @click.stop="toggleSpec(1)">立即购买</button>
 				</view>
 				
 			</view>
-		</view>
+		</view> -->
 		<!-- 规格-模态层弹窗 -->
 		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
 			<!-- 遮罩层 -->
@@ -93,12 +79,6 @@
 					<view class="right">
 						<view class="good-name clamp">{{ goodsObjact.store_name }}</view>
 						<text class="price">¥{{ (actionPrice * goodsNumber).toFixed(2) }}</text>
-						<!-- <text class="price jf">{{ goodIntegral }}</text> -->
-						<!-- <text class="stock">库存:{{ goodsObjact.stock }}件</text> -->
-						<!-- <view class="selected" v-if="goodsType == 0">
-							已选:
-							<text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">{{ sItem }}</text>
-						</view> -->
 					</view>
 				</view>
 				<view v-for="(item, index) in specList" :key="index" class="attr-list">

+ 19 - 61
pages/user/shareQrCode.vue

@@ -5,20 +5,7 @@
 				:foreground="foreground" :pdground="pdground" :icon="icon" :iconSize="iconSize" :lv="lv" :onval="onval" :showLoading="showLoading"
 				:loadMake="loadMake" :usingComponents="usingComponents" @result="qrR" />
 		</view>
-		<!-- 		<view class="qrcode-wrapper">
-			<image class="qrcode-save__image" :src="shareQrcodeUrl" mode="aspectFit"></image>
-			<view class="qrcode-save__btn">
-				
-			</view>
-		</view> -->
-		<!-- <canvas :style="{ width: canvasW + 'px', height: canvasH + 'px',}" canvas-id="myCanvas" id="myCanvas"></canvas> -->
 		<canvas :style="{ width:  '600rpx', height: '1066rpx',}" canvas-id="myCanvas" id="myCanvas" class="hb"></canvas>
-		<!-- <view class="" v-if="fina">
-			<button text="保存图片" @click="saveShareQrcode">保存图片</button>
-		</view>
-		<view class="" v-if="fina">
-			<button text="保存图片" @click="saveShareQrcode">分享链接</button>
-		</view> -->
 		<view class="btm-btn" v-if="fina">
 			<view class="btn" @click="comfirm">
 				<image src="../../static/icon/fzlj.png" mode=""></image>
@@ -95,7 +82,12 @@
 					});
 				});
 			} else {
+				// #ifdef APP-PLUS
 				this.val = 'http://hgd.liuniu946.com/appdom/index.html?spread=' + this.userInfo.uid
+				// #endif
+				// #ifdef H5
+				this.val = 'http://hgd.liuniu946.com/index/#/pages/index/index?spread=' + this.userInfo.uid
+				// #endif
 			}
 		},
 		methods: {
@@ -162,7 +154,12 @@
 				this.ratio = this.SystemInfo.windowWidth / 750;
 				this.canvasW = 600 * this.ratio;
 				this.canvasH = 1066 * this.ratio;
+				// #ifdef APP-PLUS
 				this.ewmW = 350 * this.ratio;
+				// #endif
+				// #ifdef H5
+				this.ewmW = 250 * this.ratio;
+				// #endif
 				console.log(this.canvasH, 'this.canvasH')
 				// this.canvasH = this.goodsImg.height + this.ewmW + 200;  // 画布高度 = 主图高度+二维码高度 + 文字图片的间距(大概50)
 
@@ -185,58 +182,19 @@
 						// 绘制商品主图,二维码
 						ctx.drawImage(this.goodsImg.path, 0, 0, this.canvasW, this
 							.canvasH) // drawImage(图片路径,x,y,绘制图像的宽度,绘制图像的高度)
-						ctx.drawImage(this.ewmImg.path, (this.canvasW / 2 - this.ewmW / 2),this.canvasH - 85*this.ratio - this.ewmW,
-							this.ewmW, this.ewmW) // drawImage(图片路径,x,y,绘制图像的宽度,绘制图像的高度,二维码的宽,高)
+							// #ifdef APP-PLUS
+							ctx.drawImage(this.ewmImg.path, (this.canvasW / 2 - this.ewmW / 2),this.canvasH - 85*this.ratio - this.ewmW,
+								this.ewmW, this.ewmW) // drawImage(图片路径,x,y,绘制图像的宽度,绘制图像的高度,二维码的宽,高)
+							// #endif
+							// #ifdef H5
+							ctx.drawImage(this.ewmImg.path, (this.canvasW / 2 - this.ewmW / 2),this.canvasH - 85*this.ratio - this.ewmW,
+								this.ewmW, this.ewmW) // drawImage(图片路径,x,y,绘制图像的宽度,绘制图像的高度,二维码的宽,高)
+							// #endif
+						
 
 						// 3、绘制商品标题,多余文字自动换行
 						ctx.setFontSize(16); // setFontSize() 设置字体字号
 						ctx.setFillStyle('#333'); // setFillStyle() 设置字体颜色
-
-						/* str 这段代码是我百度找的,参考别人的。canvas不能自动换行,需要自行计算 */
-						// let _strlineW = 0;
-						// let _strLastIndex = 0; //每次开始截取的字符串的索引
-						// let _strHeight = this.canvasW +20; //绘制字体距离canvas顶部的初始高度
-						// let _num = 1;
-						// for (let i = 0; i < this.title.length; i++) {
-						// 	_strlineW += ctx.measureText(this.title[i]).width;
-						// 	if (_strlineW > this.canvasW-155) {
-						// 		if(_num == 2 && 2){
-						// 			//文字换行数量大于二进行省略号处理
-						// 			ctx.fillText(this.title.substring(_strLastIndex, i-5)+'...', 40, _strHeight);
-						// 			_strlineW = 0;
-						// 			_strLastIndex = i;
-						// 			_num++;
-						// 			break;
-						// 		}else{
-						// 			ctx.fillText(this.title.substring(_strLastIndex, i), 40, _strHeight);
-						// 			_strlineW = 0;
-						// 			_strHeight += 20;
-						// 			_strLastIndex = i;
-						// 			_num++;
-						// 		}
-						// 	}else if (i == this.title.length - 1) {
-						// 		ctx.fillText(this.title.substring(_strLastIndex, i + 1), 40, _strHeight);
-						// 		_strlineW = 0;
-						// 	}
-						// }
-						/* end */
-
-						// ctx.setFontSize(16) // 字号
-						// ctx.setFillStyle('#e31d1a') // 颜色
-						// ctx.fillText('¥'+this.price, 10, this.canvasW +75); // (文字,x,y)
-						// ctx.setFontSize(12)
-						// ctx.setFillStyle('#b8b8b8')
-						// ctx.fillText('原价¥'+this.Oldprice, 100, this.canvasW +75);
-
-
-						// 邀请信息
-						// ctx.setFontSize(16)
-						// ctx.setFillStyle('#333')
-						// ctx.fillText('长按二维码立即预约', this.ewmW + 40, this.canvasW +100);
-
-						// ctx.setFontSize(16)
-						// ctx.setFillStyle('#333')
-						// ctx.fillText('分享自小程序', this.ewmW + 40, this.canvasW +120);
 						ctx.draw(false, (ret) => { // draw方法 把以上内容画到 canvas 中。
 							console.log(ret)
 							uni.showToast({