Browse Source

提交代码

twt 2 years ago
parent
commit
b4f55b629e
3 changed files with 103 additions and 17 deletions
  1. 10 10
      pages.json
  2. 5 5
      pages/addjk/activity.vue
  3. 88 2
      pages/addjk/eadit.vue

+ 10 - 10
pages.json

@@ -1,14 +1,6 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-		{
-		    "path" : "pages/addjk/activity",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "活动",
-		        "enablePullDownRefresh": true
-		    }
-		    
-		},
+		
 		{
 			"path": "pages/addjk/choice",
 			"style": {
@@ -50,9 +42,17 @@
 			"style": {
 				"navigationBarTitleText": "uni-app"
 			}
+		},
+		{
+		    "path" : "pages/addjk/activity",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "活动",
+		        "enablePullDownRefresh": true
+		    }
+		    
 		}
 		
-		
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 5 - 5
pages/addjk/activity.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="box">
 
-		<view class="itemHistory" v-for="(item,index) in itemData" :key="index" @click="goDetail(item.id)">
+		<view class="itemHistory" v-for="(item,index) in itemData" :key="index" @click="goDetail(item.ID)">
 			<image :src="item.Img" mode="" class="itemImg"></image>
 			<view class="timeBox">
 				<!-- <image v-if="item.state==2" src="../../static/img/bg_huangse.png" mode="" class="state"></image> -->
@@ -10,7 +10,7 @@
 			</view>
 			<view class="name">{{item.ActivityName}}</view>
 			
-			<view class="name" @click="goEdit(item.id)">编辑</view>
+			<view class="name" @click="goEdit(item.ID)">编辑</view>
 		</view>
 
 		<!-- 上拉 加载更多 -->
@@ -52,9 +52,9 @@
 				// })
 			},
 			goEdit(id) {
-				// uni.navigateTo({
-				// 	url: 'jkDetail?id=' + id
-				// })
+				uni.navigateTo({
+					url: 'eadit?id=' + id
+				 })
 			},
 			myOrderCoupon() {
 				uni.showLoading({

+ 88 - 2
pages/addjk/eadit.vue

@@ -97,6 +97,19 @@
 					  <textarea placeholder-class="inputPlace" v-model="activityContent" placeholder="请输入" class="textsr"/> 
 				  </view>
 			</view>
+			<view class="line2">
+				<view class="lineTitle">主图</view>
+				<view class="lineMS">此图在活动顶部显示,建议宽度750px</view>
+				<view class="lineImgBOx">
+					<view class="lineimghz" v-if="img">
+						<img src="../../static/img/del.png" alt="" class="lineimgdel" @click="delimgzt" >
+						<img :src="img" alt="" class="lineimg">
+					</view>
+					<view class="lineimghz" @click="upimgzt">
+						<img src="../../static/img/scimg.png" alt="" class="lineimg">
+					</view>
+				</view>
+			</view>
 			<view class="line2">
 				<view class="lineTitle">详情图片</view>
 				<view class="lineMS">此图在活动底部显示,可用于显示门店照片等,建议宽度750px</view>
@@ -161,11 +174,19 @@
 				imgListArr:[],
 				money:'',
 				ckMusic:'',
+				id:'',
 			}
 		},
 		onLoad(opt) {
-            this.img=opt.img
+            this.img=opt.img;
+			if(opt.id){
+				this.id=opt.id;
+				this.getDetails()
+			}
+			
+			
 		},
+		
 		onShow() {
 			const shopckList = uni.getStorageSync("shopckList");
 			this.ckMusic=uni.getStorageSync("ckmusic")
@@ -185,7 +206,72 @@
 			
 		},
 		methods: {
+		  getDetails(){
+			  uni.showLoading({
+			  	title: '加载中'
+			  })
+			  this.$http('openH5SetTheGuest/getAtivityDetails', {
+			    id:this.id
+			   },'GET').then(res => {
+			  		uni.hideLoading();
+					var jkdata=res.data.data
+					this.activityName=jkdata.activityName;
+					this.activityContent=jkdata.activityContent;
+					this.money=jkdata.money;
+					this.number=jkdata.number;
+					this.music=jkdata.music;
+					this.clWhereString=jkdata.clWhere;
+					this.clWhereList=this.clWhereString.slice(',');
+					this.startTime=jkdata.startTime.slice(0,10);
+					this.endTime=jkdata.endTime.slice(0,10);
+					this.payType=jkdata.payType
+					if(res.data.imgList){
+						res.data.imgList.forEach(item=>{
+							this.imgListArr.push(item.img)
+						})
+					}
+					console.log(this.imgListArr)
+					
+			  		//this.list=res.data
+			   })
+		  },
+		  delimgzt(){
+			this.img=''  
+		  },
+		  upimgzt(){
+		  	var that = this;
+		  	uni.chooseImage({
+				sourceType: ['album','camera'],
+				count:1, 
+				success: (chooseImageRes) => {
+					const tempFilePaths = chooseImageRes.tempFilePaths;
+					that.file=tempFilePaths[0]
+					 uni.uploadFile({
+							url: that.$request.baseUrl+'accompany/SuperCheckSheet/uploadFile', //仅为示例,非真实的接口地址
+							filePath: tempFilePaths[0],
+							name: 'file',
+							formData: {
+								'user': 'test'
+							},
+							success: (uploadFileRes) => {
+								console.log(JSON.parse(uploadFileRes.data).data );
+								that.img=JSON.parse(uploadFileRes.data).data[0]
+								//that.imgArr=that.imgArr.concat(JSON.parse(uploadFileRes.data).data) ;
+								//that.imgurl=JSON.parse(uploadFileRes.data).data[0];
+								//that.goAddzdy(that.imgurl)
+							}
+						});
+
+					
+				}
+		  	});
+		  },
 		  preview(){
+			
+			 // if(this.money==0){
+				//  this.money=0
+			 // }
+			console.log(this.money)
 			if(this.activityName==''){
 				uni.showToast({
 					 title: '请输入活动名称',
@@ -221,7 +307,7 @@
 					 duration: 2000
 				});
 				return false;
-			}else if(this.money==''){
+			}else if(this.money!=0&&this.money==''){
 				uni.showToast({
 					 title: '请输入支付金额',
 					 icon:'none',