adminthw 4 vuotta sitten
vanhempi
commit
6bff4a9ce9

+ 1 - 0
components/footer-share/footer-share.vue

@@ -66,6 +66,7 @@ export default {
   padding: 20rpx;
   background: #fff;
   margin-left: -20rpx;
+
 }
 .share-font {
   width: 45%;

+ 114 - 90
pages/activity/activity_deatil.vue

@@ -31,14 +31,15 @@
       <activityRichCard :model="textModel" :isFold="true" />
     </view>
     <view class="share-box">
-		<view class="share">
-			<button class="share" @click="shareActive()" open-type="share">
-				<image src="../../static/share_icon.png"></image>
-			</button>
-			<view class="shareCount">{{ model.share }}</view>
-		</view>
+      <view class="share">
+        <button class="share" @click="shareActive()" open-type="share">
+          <image src="../../static/share_icon.png"></image>
+        </button>
+        <view class="shareCount">{{ model.share }}</view>
+      </view>
       <view class="button">
-		  <button v-if="!isJoin"
+        <button
+          v-if="!isJoin"
           @click="subscribeActivity(model.status)"
           :disabled="!(model.status == 0 && model.type == 2)"
           :class="{
@@ -50,10 +51,8 @@
         >
           {{ model.activiteState }}
         </button>
-		<button disabled="true" class="ended" v-if="isJoin">
-		  已报名
-		</button>
-		</view>
+        <button disabled="true" class="ended" v-if="isJoin">已报名</button>
+      </view>
       <!--         "status":"活动状态 0:待开始;1:已开始; 2:已结束
         "type":"活动类型 1:线上;2 线下"} -->
     </view>
@@ -104,7 +103,7 @@ export default {
   data() {
     return {
       id: "",
-	  isJoin:false,
+      isJoin: false,
       model: {
         title: "",
         read: 123,
@@ -115,6 +114,8 @@ export default {
         way: "",
         share: 0,
         activiteState: "",
+        max_person: "",
+        person_count: "",
       },
       textModel: {
         title: "活动内容",
@@ -127,54 +128,54 @@ export default {
     this.getActivityDeatil();
   },
   methods: {
-	  shareRequest() {
-	    let md5Sign = md5(
-	      "method=" +
-	        "user" +
-	        "&timestamp=" +
-	        getApp().globalData.globalTimestamp +
-	        "&secret=" +
-	        getApp().globalData.secret
-	    );
-	    let url =
-	      getApp().globalData.shareUrl +
-	      "api/api.php" +
-	      "?method=user&source=activity&action=repost&timestamp=" +
-	      getApp().globalData.globalTimestamp +
-	      "&sign=" +
-	      md5Sign;
-	    uni.request({
-	      url: url,
-	      method: "POST",
-	      header: {
-	        "content-type": "application/x-www-form-urlencoded",
-	      },
-	      data: {
-	        openId: getApp().globalData.open_id,
-	        source_id: this.id,
-	        source: "activity",
-	      },
-	      success: (res) => {
-	        if (res.data.code === 200) {
-	          console.log(res);
-			  this.model.share = this.model.share + 1;
-	        }
-	      },
-	      fail: () => {
-	        console.log("连接失败");
-	      },
-	    });
-	  },
-	shareActive(){
-		let that = this;
-		uni.showShareMenu({
-		  title: that.model.title,
-		  path: "pages/activity/activity_detail?id=" + that.id,
-		  success(res) {
-		    that.shareRequest();
-		  },
-		});
-	},
+    shareRequest() {
+      let md5Sign = md5(
+        "method=" +
+          "user" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=user&source=activity&action=repost&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: {
+          openId: getApp().globalData.open_id,
+          source_id: this.id,
+          source: "activity",
+        },
+        success: (res) => {
+          if (res.data.code === 200) {
+            console.log(res);
+            this.model.share = this.model.share + 1;
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
+    shareActive() {
+      let that = this;
+      uni.showShareMenu({
+        title: that.model.title,
+        path: "pages/activity/activity_detail?id=" + that.id,
+        success(res) {
+          that.shareRequest();
+        },
+      });
+    },
     getActivityDeatil() {
       let md5Sign = md5(
         "method=" +
@@ -193,7 +194,7 @@ export default {
         md5Sign;
       let postData = {
         id: this.id,
-		openId:getApp().globalData.open_id
+        openId: getApp().globalData.open_id,
       };
       //获取文章
       uni.request({
@@ -206,7 +207,7 @@ export default {
         success: (res) => {
           if (res.data.code == 200) {
             let data = res.data.data;
-			this.isJoin = data.active ? true : false;
+            this.isJoin = data.active ? true : false;
             this.model.title = data.name;
             this.model.read =
               parseInt(data.base_read_count) + parseInt(data.real_read_count);
@@ -224,6 +225,10 @@ export default {
             this.model.type = data.type;
             this.model.status = data.status;
             this.model.way = data.sponsor;
+            // this.model.max_person = data.max_person;
+            // this.model.person_count = data.person_count;
+                    this.model.max_person = 1;
+            this.model.person_count = 2;
             this.model.share =
               parseInt(data.real_repost_count) +
               parseInt(data.base_repost_count);
@@ -246,12 +251,20 @@ export default {
         },
       });
     },
-	replaceImg(html){
-			  let result = html.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match,capture) {
-					return '<img src=' + getApp().globalData.shareUrl + capture +' style="max-width:100%;height:auto;display:block;margin:10px 0;"/>';
-			  });
-			 return result
-	},
+    replaceImg(html) {
+      let result = html.replace(
+        /<img [^>]*src=['"]([^'"]+)[^>]*>/gi,
+        function (match, capture) {
+          return (
+            "<img src=" +
+            getApp().globalData.shareUrl +
+            capture +
+            ' style="max-width:100%;height:auto;display:block;margin:10px 0;"/>'
+          );
+        }
+      );
+      return result;
+    },
     getRich() {
       uni.request({
         url:
@@ -263,7 +276,7 @@ export default {
         },
         success: (res) => {
           if (res.statusCode === 200) {
-           this.textModel.text = this.replaceImg(res.data);
+            this.textModel.text = this.replaceImg(res.data);
           }
         },
         fail: () => {
@@ -271,17 +284,28 @@ export default {
         },
       });
     },
-	subscribeActivity(status){
-		console.log(status)
-		let that = this;
-		uni.requestSubscribeMessage({
-		  tmplIds: ['bSg5tUWHE4qWDeyK31GBejogT1uRgkuBD1_n2I5ptAc','T_ORLiW2C_UM6nZiEerYAokltHgHRGxWCid8eElujus'],
-		  success (res) {
-			  console.log(res)
-			  that.signUpActivity()
-		  }
-		})
-	},
+    subscribeActivity(status) {
+      if (this.model.person_count >= this.model.max_person) {
+        uni.showToast({
+          title: "报名人数已上限",
+          icon:'error',
+          duration: 2000,
+        });
+        return
+      }
+      console.log(status);
+      let that = this;
+      uni.requestSubscribeMessage({
+        tmplIds: [
+          "bSg5tUWHE4qWDeyK31GBejogT1uRgkuBD1_n2I5ptAc",
+          "T_ORLiW2C_UM6nZiEerYAokltHgHRGxWCid8eElujus",
+        ],
+        success(res) {
+          console.log(res);
+          that.signUpActivity();
+        },
+      });
+    },
     signUpActivity() {
       let md5Sign = md5(
         "method=" +
@@ -311,12 +335,12 @@ export default {
         data: postData,
         success: (res) => {
           if (res.data.code == 200) {
-			this.isJoin = true;
-			uni.showToast({
-				title:'报名成功',
-				icon:'none',
-				duration:2500
-			})
+            this.isJoin = true;
+            uni.showToast({
+              title: "报名成功",
+              icon: "none",
+              duration: 2500,
+            });
           }
         },
         fail: () => {
@@ -404,13 +428,13 @@ export default {
       width: 50rpx;
       height: 50rpx;
       position: relative;
-	  button::after {
-		  border: none;
-	  }
+      button::after {
+        border: none;
+      }
       image {
         width: 100%;
         height: 100%;
-		position: absolute;
+        position: absolute;
       }
       .shareCount {
         display: flex;

+ 18 - 2
pages/attract/index.vue

@@ -5,6 +5,7 @@
     </view>
     <view class="attracts">
       <view class="activity-theme">活动主题</view>
+
       <view
         class="notice-content-box"
         v-for="(item, index) in attractList"
@@ -13,6 +14,7 @@
         @click="goAttractDeatil(item.id, item.time_type)"
         :class="{ unclick: item.time_type == 0 }"
       >
+        <view v-if="!(item.time_type == 1)" class="forward">敬请期待</view>
         <image
           :src="item.pic_url"
           mode="aspectFill"
@@ -23,7 +25,12 @@
             border-radius: 10rpx;
           "
         ></image>
-        <view class="notice-content" style="width: 75%">
+        <view
+          class="notice-content"
+          style="
+            width: 75%;
+          "
+        >
           <view class="notice-content-font">{{ item.title }}</view>
           <view class="attract-content">{{ item.desc }}</view>
           <view
@@ -157,6 +164,15 @@ export default {
       border-radius: 32rpx;
       margin-top: 20rpx;
       justify-content: space-between;
+      position: relative;
+      .forward {
+        position: absolute;
+        top: 50%;
+        left: 50%;
+        transform: translate(-50%, -50%);
+        color: #ffffff;
+        font-weight: 500;
+      }
       .notice-content-font {
         font-size: 26rpx;
         color: #0d1937;
@@ -175,7 +191,7 @@ export default {
         white-space: nowrap;
       }
       .notice-content-time {
-        font-size: 18rpx;
+        font-size: 20rpx;
         letter-spacing: 0.02em;
         color: #cfcfcf;
         margin-right: 14rpx;

+ 2 - 2
pages/enterprise/enterprise_detail.vue

@@ -2,7 +2,7 @@
   <view class="content" :class="{ 'margin-bottom-80': isMar }" v-if="isShow">
     <view class="title">
       <view class="logo">
-        <image :src="'https://kiq.xazhima.com' + info.pic_url" alt=""></image>
+        <image :src="'https://kiq.xazhima.com' + info.pic_url" alt=""  mode="aspectFit"></image>
       </view>
       <view class="name">
         {{ info.name || '-'}}
@@ -69,7 +69,7 @@
           :key="idx"
         >
           <view class="img">
-            <image :src="'https://kiq.xazhima.com' + item.pic_url"></image>
+            <image :src="'https://kiq.xazhima.com' + item.pic_url"   mode="aspectFit"></image>
           </view>
           <view class="name">{{ item.name || '-'}}</view>
         </view>

+ 3 - 3
pages/enterprise/product_detail.vue

@@ -2,7 +2,7 @@
   <div class="content">
     <div class="title">
       <div class="logo">
-        <img :src="logo" alt="" />
+        <img :src="logo" alt="" mode="aspectFit" />
       </div>
       <div class="name">
         {{ name }}
@@ -27,8 +27,8 @@ export default {
   data() {
     return {
       company: "",
-      logo:getApp().globalData.company_logo,
-      name:getApp().globalData.company_name
+      logo: getApp().globalData.company_logo,
+      name: getApp().globalData.company_name,
     };
   },
   methods: {

+ 46 - 13
pages/index/index.vue

@@ -206,18 +206,48 @@
         class="notice-content-box"
         v-for="(item, index) in attractList"
         :key="index"
-        style="justify-content: start"
+        style="justify-content: start; position: relative"
         @click="goAttractDeatil(item.id)"
+        :class="{ unclick: item.time_type == 0 }"
       >
+        <view
+          v-if="!(item.time_type == 1)"
+          class="forward"
+          style="
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            color: #ffffff;
+            font-weight: 500;
+          "
+          >敬请期待</view
+        >
         <image
           :src="item.pic_url"
           mode="aspectFill"
-          style="width: 112rpx; height: 112rpx; margin-right: 20rpx;border-radius: 10rpx;"
+          style="
+            width: 112rpx;
+            height: 112rpx;
+            margin-right: 20rpx;
+            border-radius: 10rpx;
+          "
         ></image>
         <view class="notice-content" style="width: 75%">
           <view class="notice-content-font">{{ item.title }}</view>
           <view class="attract-content">{{ item.desc }}</view>
-          <view class="notice-content-time" style="margin-top: 20rpx">{{item.addtime | globalTime}}</view>
+          <view
+            class="notice-content-time"
+            style="margin-top: 20rpx; font-size: 20rpx"
+            v-if="item.time_type == 1"
+            >{{ item.time | globalTime }}</view
+          >
+          <view
+            class="notice-content-time"
+            style="margin-top: 20rpx; font-size: 20rpx"
+            v-else
+            >时间:待定</view
+          >
         </view>
       </view>
     </view>
@@ -299,7 +329,7 @@ export default {
     return {
       title: "Air企通",
       scrollVal: Number,
-	  footFlag:true,
+      footFlag: true,
       swiperList: [
         {
           img: "/static/swiper/swiper1.jpg",
@@ -613,10 +643,10 @@ export default {
         data: postData,
         success: (res) => {
           if (res.data.code === 200) {
-			  res.data.data.list.forEach((item) => {
-			    item.pic_url = getApp().globalData.shareUrl + item.pic_url;
-			  });
-        this.attractList = res.data.data.list;
+            res.data.data.list.forEach((item) => {
+              item.pic_url = getApp().globalData.shareUrl + item.pic_url;
+            });
+            this.attractList = res.data.data.list;
           }
         },
         fail: () => {
@@ -642,7 +672,7 @@ export default {
         md5Sign;
       let postData = {
         page: 1,
-        page_size:2,
+        page_size: 2,
       };
       uni.request({
         url: url,
@@ -733,17 +763,20 @@ export default {
   },
   onPageScroll(e) {
     this.scrollVal = e.scrollTop;
-	if(e.scrollTop < uni.getSystemInfoSync().windowHeight){
-		this.footFlag = true;
-	}
+    if (e.scrollTop < uni.getSystemInfoSync().windowHeight) {
+      this.footFlag = true;
+    }
   },
   onReachBottom() {
-	  this.footFlag = false;
+    this.footFlag = false;
   },
 };
 </script>
 
 <style>
+.unclick {
+  background-color: #bfbfbf !important;
+}
 .content {
   display: flex;
   flex-direction: column;

+ 8 - 5
pages/supply/index.vue

@@ -96,16 +96,16 @@ export default {
         getApp().globalData.globalTimestamp +
         "&sign=" +
         md5Sign;
-        let postData = {
-           s_type:this.index==2?1:2
-        }
+      let postData = {
+        s_type: this.index == 2 ? 1 : 2,
+      };
       uni.request({
         url: url,
         method: "POST",
         header: {
           "content-type": "application/x-www-form-urlencoded",
         },
-        data: this.index==-1||this.index==0?{}:postData,
+        data: this.index == -1 || this.index == 0 ? {} : postData,
         success: (res) => {
           if (res.data.code === 200) {
             let list = res.data.data.list;
@@ -135,7 +135,10 @@ export default {
               );
               ob.time = time + " " + timeSecond;
               ob.state = item.type;
-              ob.image = item.url;
+               ob.image = ''
+              // ob.image = item.attach_list[0]
+              //   ? getApp().globalData.shareUrl + item.attach_list[0].url
+              //   : "";
               return ob;
             });
             // console.log(res.data.data.list);

+ 5 - 7
pages/supply/mySupply.vue

@@ -29,12 +29,8 @@
             <view class="time">发布时间:{{ supply.time }}</view>
           </view>
           <view class="state">
-         
-            <image
-              src="/static/supply/u1830.png"
-              v-if="supply.state == -1"
-            />
-            <image src="/static/supply/u1829.png"   v-if="supply.state == 0" />
+            <image src="/static/supply/u1830.png" v-if="supply.state == -1" />
+            <image src="/static/supply/u1829.png" v-if="supply.state == 0" />
           </view>
         </view>
       </view>
@@ -115,7 +111,9 @@ export default {
               );
               ob.time = time + " " + timeSecond;
               ob.state = item.approve_status;
-              ob.image = item.url;
+              ob.image = item.attach_list[0]
+                ? getApp().globalData.shareUrl + item.attach_list[0].url
+                : "";
               return ob;
             });
             console.log(res.data.data.list);