Ver código fonte

更新 'pages/index/index.vue'

wenxin 2 anos atrás
pai
commit
1730fe81ad
1 arquivos alterados com 57 adições e 14 exclusões
  1. 57 14
      pages/index/index.vue

+ 57 - 14
pages/index/index.vue

xqd xqd xqd xqd
@@ -16,24 +16,30 @@
 				<tn-waterfall v-if="drawList.length>0" ref="waterfall" v-model="drawList"
 					@finish="handleWaterFallFinish">
 					<template v-slot:left="{ leftList }">
-						<view v-for="(item, index) in leftList" :key="item.id" class="product__item"
-							@click="tnproduct(item.id)">
-							<view class="item__image">
+						<view v-for="(item, index) in leftList" :key="item.id" class="product__item" @click="tnproduct(item.id)"
+							>
+							<!-- 这里使用.stop修饰符,阻止 -->
+							<view class="item__image" >
 								<tn-lazy-load :threshold="6000" height="100%"
-									:image="item.imgs_file[0]?item.imgs_file[0]:item.origin_url" :index="item.id"
-									imgMode="widthFix"></tn-lazy-load>
+									:image="item.imgs_file[0]?item.imgs_file[0]:item.previewUrl" :index="item.id"
+									imgMode="widthFix">	</tn-lazy-load>
+				<!-- 	<button class="item__btn" size="mini" @click="drawStyle">绘制同款</button> -->
+				<view class="item__btn" @click.stop="drawStyle(item)">绘制同款</view>
 							</view>
 						</view>
 					</template>
 					<template v-slot:right="{ rightList }">
-						<view v-for="(item, index) in rightList" :key="item.id" class="product__item"
-							@click="tnproduct(item.id)">
-							<view class="item__image">
+						<view v-for="(item, index) in rightList" :key="item.id" class="product__item" @click="tnproduct(item.id)"
+							>
+							<view class="item__image" >
 								<tn-lazy-load :threshold="6000" height="100%"
-									:image="item.imgs_file[0]?item.imgs_file[0]:item.origin_url" :index="item.id"
-									imgMode="widthFix"></tn-lazy-load>
+									:image="item.imgs_file[0]?item.imgs_file[0]:item.previewUrl" :index="item.id"
+									imgMode="widthFix">
+									</tn-lazy-load>
+										<view class="item__btn" @click.stop="drawStyle(item)">绘制同款</view>
 							</view>
 						</view>
+						
 					</template>
 				</tn-waterfall>
 				<!-- <wike-waterfall :dataList="data" :column="columns" @click="click" :radius="20" :margin="10"></wike-waterfall> -->
@@ -91,7 +97,7 @@
 		data() {
 			return {
 				leadBaseUrl: BaseUrl.leadBaseUrl,
-
+swiperList:[],
 				showInitLead: false,
 				showLead2: false,
 				showLead1: true,
@@ -165,6 +171,46 @@
 				this.showLead1 = false
 				this.showLead2 = true
 			},
+			// gallerydetail(item){
+			// 	let that = this
+			// 	this.$http('gallery.detail',{
+			// 		id:item.id,
+			// 		type:item.engine
+			// 	}).then(res=>{
+			// 		if(res.code == 0){
+			// 			if(this.engin == 'sd'){
+			// 				for(var i =0;i<res.data.imgs_file.length;i++){
+			// 			var url={
+			// 				id: res.data.id,
+			// 				type: 'image',
+			// 				url: res.data.imgs_file[i],
+			// 			}		
+			// 				}
+			// 			}
+						
+			// 		}
+			// 	})
+			// },
+			
+			
+			
+		
+			
+			drawStyle(item){
+				 console.log(item)
+			if(item.engine == 'rh'){
+				uni.navigateTo({
+					url:'/pages/painting/draw?rh_modalId=-1&rh_modalurl='+item.previewUrl
+				})
+				console.log('/pages/painting/draw?rh_modalId=-1&rh='+item.previewUrl,66666666666666)
+			}else if(item.engine == 'mj'){
+				uni.navigateTo({
+					url:'/pages/painting/draw?prompt='+item.prompt+'&engine'+item.engine+'&model_name'+item.mode+'&refImg='+'undefined'
+				})
+			}
+				console.log(3333333333,item)
+			
+			},
 			finishLead() {
 				this.showInitLead = false
 				this.showLead2 = false
@@ -240,9 +286,6 @@
 
 				uni.navigateTo({
 					url: '/pages/painting/details?urls=' + id + '&from=' + this.engine
-
-					// + '&form=' + JSON.stringify(
-					// this.form)
 				})
 			}
 		}