Selaa lähdekoodia

修改收藏问题

306132416@qq.com 4 vuotta sitten
vanhempi
commit
3762691368
3 muutettua tiedostoa jossa 46 lisäystä ja 18 poistoa
  1. 1 0
      pages/auth/index.vue
  2. 23 1
      pages/policy/policy_deatil.vue
  3. 22 17
      pages/selfCenter/collection.vue

+ 1 - 0
pages/auth/index.vue

@@ -49,6 +49,7 @@
 								if(res.data.data.nickname){
 									getApp().globalData.isAuth = true;
 									getApp().globalData.user_phone = false;
+									getApp().globalData.user_name = res.data.data.nickname;
 									this.isAuth = true;
 									this.isNeedPhone = false;
 								}else{

+ 23 - 1
pages/policy/policy_deatil.vue

@@ -202,8 +202,8 @@ export default {
   },
   onLoad(option) {
     let id = option.id;
-    console.log(id);
     this.getDetailInfo(id);
+	this.getUserAuth();
   },
   onShow() {
   },
@@ -213,6 +213,28 @@ export default {
 			url:'../auth/index'
 		})
 	},
+	getUserAuth(){
+		let md5Sign = md5("method="+'user'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
+		let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&action=info_by_openid&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
+			},
+			success: (res) => {
+				if(res.data.code === 200){
+					res.data.data.nickname ? getApp().globalData.user_name = res.data.data.nickname :getApp().globalData.user_name = ''
+				}
+			},
+			fail: () => {
+				console.log("连接失败");
+			}
+		});
+	},
     getDetailInfo(ids) {
       let md5Sign = md5(
         "method=" +

+ 22 - 17
pages/selfCenter/collection.vue

@@ -20,7 +20,7 @@
           @click="enterPolicyDeatil(item.id)"
         >
           <view class="policy-content-item-left">
-            <p class="policy-content-item-left-title" style="height: 70rpx">
+            <p class="policy-content-item-left-title">
               {{ item.title }}
             </p>
             <view class="policy-content-item-left-time">
@@ -77,19 +77,23 @@ export default {
       active: 0,
       searchVal: "",
       policyData: [],
-      companyList: new Array(5).fill({
-        logo: "/static/enterprise/logo.png",
-        name: "康拓科技有限责任公司",
-        info: {
-          person: "马须伦",
-          money: "1,776,759.3万(元)",
-          time: "1995-03-25",
-        },
-      }),
+      // companyList: new Array(5).fill({
+      //   logo: "/static/enterprise/logo.png",
+      //   name: "康拓科技有限责任公司",
+      //   info: {
+      //     person: "马须伦",
+      //     money: "1,776,759.3万(元)",
+      //     time: "1995-03-25",
+      //   },
+      // }),
+	  companyList: []
     };
   },
   onLoad() {
-    this.getCollection();
+    //this.getCollection();
+  },
+  onShow() {
+  	 this.getCollection();
   },
   methods: {
     toDetail(id) {
@@ -253,8 +257,9 @@ export default {
       .policy-content-item-left {
         display: flex;
         flex-direction: column;
-        width: 70%;
+        width: 98%;
         .policy-content-item-left-title {
+		  font-weight: 550;
           text-overflow: -o-ellipsis-lastline;
           overflow: hidden;
           text-overflow: ellipsis;
@@ -262,8 +267,8 @@ export default {
           -webkit-line-clamp: 2;
           line-clamp: 2;
           -webkit-box-orient: vertical;
-          font-size: 25rpx;
-          margin-bottom: 2rpx;
+          font-size: 26rpx;
+          margin-bottom: 20rpx;
         }
         .policy-content-item-left-time {
           width: 100%;
@@ -271,11 +276,11 @@ export default {
           align-items: center;
           .moment {
             color: #c1c1c1;
-            font-size: 20rpx;
+            font-size: 22rpx;
             margin-right: 20rpx;
           }
           .maxMony {
-            font-size: 20rpx;
+            font-size: 22rpx;
             color: #00bfbf;
             border: 1px solid #00bfbf;
             padding: 10rpx;
@@ -283,7 +288,7 @@ export default {
             border-radius: 12rpx;
           }
           .leftDay {
-            font-size: 20rpx;
+            font-size: 22rpx;
             background: #f7bbc3;
             color: #e32579;
             padding: 10rpx;