Pārlūkot izejas kodu

我的、我的会员

wangzhiqiang 1 mēnesi atpakaļ
vecāks
revīzija
39db5d90cb
6 mainītis faili ar 527 papildinājumiem un 81 dzēšanām
  1. 9 0
      .hbuilderx/launch.json
  2. 21 12
      pages.json
  3. 273 18
      pages/activateVIP/index.vue
  4. 189 50
      pages/my/index.vue
  5. 3 0
      static/css/fui.css
  6. 32 1
      utils/index.js

+ 9 - 0
.hbuilderx/launch.json

@@ -0,0 +1,9 @@
+{
+    "version" : "1.0",
+    "configurations" : [
+        {
+            "playground" : "standard",
+            "type" : "uni-app:app-ios"
+        }
+    ]
+}

+ 21 - 12
pages.json

@@ -151,37 +151,43 @@
 		{
 			"path": "pages/activateVIP/index",
 			"style": {
-				"navigationBarTitleText": "开通会员"
+				// "navigationBarTitleText": "开通会员"
+				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path": "pages/setting/index",
 			"style": {
-				"navigationBarTitleText": "系统设置"
+				// "navigationBarTitleText": "系统设置"
+				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path": "pages/setting/accountSecurity",
 			"style": {
-				"navigationBarTitleText": "账户安全"
+				// "navigationBarTitleText": "账户安全"
+				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path": "pages/setting/changePassword",
 			"style": {
-				"navigationBarTitleText": "修改密码"
+				// "navigationBarTitleText": "修改密码"
+				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path": "pages/setting/retrievePassword",
 			"style": {
-				"navigationBarTitleText": "找回密码"
+				// "navigationBarTitleText": "找回密码"
+				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path": "pages/index/notice",
 			"style": {
-				"navigationBarTitleText": "公告"
+				// "navigationBarTitleText": "公告"
+				"navigationStyle": "custom"
 			}
 		},
 		{
@@ -208,19 +214,22 @@
 		{
 			"path": "pages/index/gettingStarted",
 			"style": {
-				"navigationBarTitleText": "新手入门"
+				// "navigationBarTitleText": "新手入门"
+				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path": "pages/index/startedDetails",
 			"style": {
-				"navigationBarTitleText": "详情"
+				// "navigationBarTitleText": "详情"
+				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path": "pages/index/popularBounty",
 			"style": {
-				"navigationBarTitleText": "热门悬赏"
+				// "navigationBarTitleText": "热门悬赏"
+				"navigationStyle": "custom"
 			}
 		},
 		{
@@ -271,13 +280,13 @@
 				"text": "首页",
 				"pagePath": "pages/index/index",
 				"iconPath": "/static/tabbar/home.png",
-				"selectedIconPath": "/static/tabbar/homeCheck.png"
+				"selectedIconPath": "/static/tabbar/home_check.png"
 			},
 			{
-				"text": "我的",
+				"text": "个人中心",
 				"pagePath": "pages/my/index",
 				"iconPath": "/static/tabbar/my.png",
-				"selectedIconPath": "/static/tabbar/myCheck.png"
+				"selectedIconPath": "/static/tabbar/my_check.png"
 			}
 		]
 	},

+ 273 - 18
pages/activateVIP/index.vue

@@ -1,25 +1,280 @@
 <template>
-	<view class="content">
-		开通会员
-	</view>
+  <view class="content pdx-48">
+    <view class="top_bg pdx-48">
+      <view class="w h-88 flex ai_center jc_center mgt-88 p-rel">
+        <image
+          @click="$navBack()"
+          class="w-48 h-48 abs_left"
+          src="/static/image/common/left_arrow_icon.png"
+          mode="scaleToFill"
+        />
+        <view class="text-36 text-500 text-070202">开通会员</view>
+      </view>
+
+      <view class="head" @click="$navTo('/pages/personalProfile/index')">
+        <view class="flex fd_c">
+          <view class="text-36 text-070202 text-500">用户名称用户名称</view>
+          <!-- <view class="vip_year_bg"> lv.1年 </view> -->
+          <view class="vip_bg">普通会员</view>
+        </view>
+        <!-- 
+			未登录时头像
+			/static/image/my/no_login_avatar.png 
+		  -->
+        <image
+          class="image"
+          src="/static/image/my/my_default_avatar.png"
+        ></image>
+      </view>
+
+      <view class="w h-96 flex ai_center mgt-42">
+        <view
+          v-for="(item, index) in menuList"
+          :key="item"
+          class="menu"
+          :class="menuIndex === index ? 'check_menu' : 'default_menu'"
+          @click="handleMenu(index)"
+        >
+          <view>{{ item }}</view>
+          <view
+            class="menu_line"
+            :style="{
+              backgroundColor:
+                menuIndex === index ? ' #fe6505' : ' transparent',
+            }"
+          ></view>
+        </view>
+      </view>
+    </view>
+
+    <view style="width: 100vw; padding: 0 32rpx; margin-top: -62rpx">
+      <view class="rights">
+        <view class="title text-28 text-500 text-white">开通权益</view>
+        <view class="rights_box w flex jc_between">
+          <view
+            class="rights_item flex fd_c w-128"
+            v-for="item in rightsList"
+            :key="item.icon"
+          >
+            <image class="w-72 h-72" :src="item.icon" mode="scaleToFill" />
+            <view
+              class="text text-20 text-400 text-7E7E7E"
+              v-html="item.content"
+            >
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+
+    <button class="btn">立即开通</button>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-		onLoad() {
-
-		},
-		methods: {
-
-		}
-	}
+export default {
+  data() {
+    return {
+      menuList: ["月度会员", "季度会员", "年度会员"],
+      menuIndex: 0,
+      rightsList: [
+        {
+          icon: "/static/image/vip/publish_tasks_icon.png",
+          content: `
+			发布任务<br>
+			服务费<text class="text-500 text-FF9F38">13%</text>`,
+        },
+        {
+          icon: "/static/image/vip/tools_use_icon.png",
+          content: `
+			工具使用优惠<br>
+			折扣<text class="text-500 text-FF9F38">9折</text>`,
+        },
+        {
+          icon: "/static/image/vip/give_icon.png",
+          content: `
+			赠送<text class="text-500 text-FF9F38">2小时</text>
+			<br>置顶`,
+        },
+        {
+          icon: "/static/image/vip/edit_tasks_icon.png",
+          content: `
+			发布/修改任务<br>
+			数量限制<text class="text-500 text-FF9F38">10次</text>`,
+        },
+        {
+          icon: "/static/image/vip/give_icon.png",
+          content: `
+			可发布类型:<br>
+			<text class="text-500 text-FF9F38">高价悬赏</text>`,
+        },
+      ],
+    };
+  },
+  computed: {},
+  onLoad() {},
+  methods: {
+    handleMenu(index) {
+      this.menuIndex = index;
+    },
+  },
+};
 </script>
 
-<style scoped lang="scss">
-	
+<style lang="scss" scope>
+.content {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+.top_bg {
+  width: 100vw;
+  height: 568rpx;
+  flex-shrink: 0;
+  // background: linear-gradient(to bottom, #ffd8bf, #ffffff);
+  background: linear-gradient(180deg, #ffd8bf 10%, #fff 65%);
+
+  .head {
+    margin-top: 32rpx;
+    height: 144rpx;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+
+    .vip_icon {
+      margin-top: 16rpx;
+      width: 112rpx;
+      height: 44rpx;
+    }
+    .image {
+      width: 144rpx;
+      height: 144rpx;
+      border-radius: 50%;
+    }
+  }
+}
+
+.vip_year_bg {
+  margin-top: 16rpx;
+  width: 112rpx;
+  height: 44rpx;
+  background: url("/static//image/my/vip_year_bg.png");
+  background-size: cover;
+  display: flex;
+  align-items: center;
+  color: #ffffff;
+  font-family: "MiSans VF";
+  font-size: 22rpx;
+  font-weight: 500;
+  letter-spacing: 0.66rpx;
+  padding-left: 42rpx;
+}
+
+.vip_bg {
+  margin-top: 16rpx;
+  width: 144rpx;
+  height: 48rpx;
+  line-height: 40rpx;
+  background: url("/static//image/my/vip_bg.png");
+  background-size: cover;
+  padding-left: 42rpx;
+  color: #ffffff;
+  font-family: "MiSans VF";
+  font-size: 22rpx;
+  font-weight: 500;
+  letter-spacing: -0.66rpx;
+}
+
+.check_menu {
+  color: #070202;
+  font-size: 36rpx;
+  font-weight: 600;
+}
+
+.default_menu {
+  color: #7e7e7e;
+  font-size: 32rpx;
+  font-weight: 500;
+}
+
+.menu_line {
+  margin-top: 8rpx;
+  width: 32rpx;
+  height: 10rpx;
+}
+
+.menu {
+  margin-right: 48rpx;
+  text-align: center;
+  font-family: "MiSans VF";
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+.rights {
+  width: 100%;
+  height: 322rpx;
+  border-radius: 24rpx 24rpx 0 0;
+  background: linear-gradient(180deg, #ff6606 0%, #ff9a5c 100%);
+  //   background: url("/static//image/vip/rights_bg.png");
+  //   background-size: cover;
+  //   padding:  20rpx 24rpx 40rpx 24rpx;
+  position: relative;
+
+  .title {
+    position: absolute;
+    top: 20rpx;
+    left: 24rpx;
+  }
+  .rights_box {
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    width: 100%;
+    height: 244rpx;
+    border-radius: 24rpx 24rpx 0 0;
+    background: linear-gradient(180deg, #fff 0%, #ffffffe6 100%);
+
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 0 7rpx;
+
+    .rights_item {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+
+      .text {
+        margin-top: 28rpx;
+        text-align: center;
+        letter-spacing: -0.66rpx;
+        line-height: 1.4;
+      }
+    }
+  }
+}
+
+.btn {
+  position: absolute;
+  left: 50%;
+  bottom: 262rpx;
+  transform: translateX(-50%);
+  width: 88%;
+  height: 96rpx;
+  line-height: 96rpx;
+  flex-shrink: 0;
+  border-radius: 64rpx;
+  background: #fe6505;
+  color: #ffffff;
+  text-align: center;
+  font-family: "MiSans VF";
+  font-size: 36rpx;
+  font-weight: 500;
+}
 </style>

+ 189 - 50
pages/my/index.vue

@@ -4,29 +4,45 @@
       <view class="head" @click="$navTo('/pages/personalProfile/index')">
         <view class="flex fd_c">
           <view class="text-36 text-070202 text-500">用户名称用户名称</view>
-          <image class="vip_icon" src="/static/logo.png"></image>
+          <view class="vip_year_bg"> lv.1年 </view>
+          <!-- <view class="vip_bg">普通会员</view> -->
         </view>
-        <image class="image" src="/static/logo.png"></image>
+        <!-- 
+          未登录时头像
+          /static/image/my/no_login_avatar.png 
+        -->
+        <image
+          class="image"
+          src="/static/image/my/my_default_avatar.png"
+        ></image>
       </view>
 
       <view class="info">
-        <view class="info_item">
-          <view class="text-40 text-400 text-070202">1322</view>
+        <view class="info_item" @click="$navTo('/pages/myTakeOrder/index')">
+          <view class="text-40 text-400 text-070202">
+            {{ tagList.takeOrders || 0 }}
+          </view>
           <view class="text-24 text-500 text-C8C9C6 mgt-8">我的接单</view>
         </view>
         <view class="line"></view>
-        <view class="info_item">
-          <view class="text-40 text-400 text-070202">322</view>
+        <view class="info_item" @click="$navTo('/pages/myBounty/index')">
+          <view class="text-40 text-400 text-070202">
+            {{ tagList.myBounty || 0 }}
+          </view>
           <view class="text-24 text-500 text-C8C9C6 mgt-8">我的悬赏</view>
         </view>
         <view class="line"></view>
-        <view class="info_item">
-          <view class="text-40 text-400 text-070202">32</view>
+        <view class="info_item" @click="$navTo('/pages/activateVIP/index')">
+          <view class="text-40 text-400 text-070202">
+            {{ tagList.myVip || 0 }}
+          </view>
           <view class="text-24 text-500 text-C8C9C6 mgt-8">开通会员</view>
         </view>
         <view class="line"></view>
-        <view class="info_item">
-          <view class="text-40 text-400 text-070202">22</view>
+        <view class="info_item" @click="$navTo('/pages/inviteFriends/index')">
+          <view class="text-40 text-400 text-070202">
+            {{ tagList.invite || 0 }}
+          </view>
           <view class="text-24 text-500 text-C8C9C6 mgt-8">邀请好友</view>
         </view>
       </view>
@@ -46,12 +62,38 @@
       </view>
     </view>
 
-    <image class="radio-16 h-128 w mgt-24" src="/static/logo.png"></image>
-    <image class="radio-16 h-144 w mgt-24" src="/static/logo.png"></image>
+    <view class="new_hand">
+      <view class="top">
+        <view class="flex ai_center">
+          <view class="lv">V1</view>
+          <view class="mgl-12 text-white text-24 text-400">新手上路</view>
+        </view>
+        <view class="btn"> 查看攻略 </view>
+      </view>
+      <view class="bottom">
+        <view class="progress_bg flex1">
+          <view
+            class="progress_bar"
+            :style="{
+              width: `${progressBar * 100}%`,
+              borderRadius: progressBar === 1 ? '64rpx' : '64rpx 0 0 64rpx',
+            }"
+          ></view>
+        </view>
+        <view class="mgl-16 text-18 text-400 text-white"
+          >等级越高赚钱越多
+        </view>
+      </view>
+    </view>
+
+    <image
+      class="radio-16 h-144 w mgt-24"
+      src="/static/image/my/post_reward.png"
+    ></image>
 
     <view class="w mgt-24 pdb-30">
       <view
-        class="w h-96 flex jc_between ai_center mgt-8 menu_item"
+        class="w h-96 flex jc_between ai_center mgt-8 border-bottom-F2F2F7"
         v-for="item in menuList"
         :key="item.name"
         @click="$navTo(item.pagePath)"
@@ -61,9 +103,15 @@
           <view class="mgl-20 text-28 text-400 text-303030">
             {{ item.name }}
           </view>
-          <view v-if="item.name === '我的消息'" class="badge">99+</view>
+          <view v-if="item.badge" class="badge">{{
+            badgeNum(item.badge)
+          }}</view>
         </view>
-        <image class="w-48 h-48" src="/static/logo.png" mode="scaleToFill" />
+        <image
+          class="w-48 h-48"
+          src="/static/image/common/right_arrow_icon.png"
+          mode="scaleToFill"
+        />
       </view>
     </view>
   </view>
@@ -74,64 +122,57 @@ export default {
   data() {
     return {
       title: "我的",
-      tagList: [
-        {
-          icon: "/static/logo.png",
-          name: "我的接单",
-          pagePath: "/pages/myTakeOrder/index",
-        },
-        {
-          icon: "/static/logo.png",
-          name: "我的悬赏",
-          pagePath: "/pages/myBounty/index",
-        },
-        {
-          icon: "/static/logo.png",
-          name: "开通会员",
-          pagePath: "/pages/activateVIP/index",
-        },
-        {
-          icon: "/static/logo.png",
-          name: "邀请好友",
-          pagePath: "/pages/inviteFriends/index",
-        },
-      ],
+      progressBar: 0.2, //新手上路 进度条%
+      tagList: {
+        takeOrders: 1322, //我的接单
+        myBounty: 322, //我的悬赏
+        myVip: 32, //开通会员
+        invite: 22, //邀请好友
+      },
+
       menuList: [
         {
-          icon: "/static/logo.png",
+          icon: "/static/image/my/tools_icon.png",
           name: "我的工具包",
           pagePath: "/pages/myTools/index",
         },
         {
-          icon: "/static/logo.png",
+          icon: "/static/image/my/message_icon.png",
           name: "我的消息",
           pagePath: "/pages/myMessage/index",
+          badge: 100,
         },
         {
-          icon: "/static/logo.png",
+          icon: "/static/image/my/safeguard_rights_icon.png",
           name: "维权",
           pagePath: "/pages/safeguardRights/index",
         },
         {
-          icon: "/static/logo.png",
+          icon: "/static/image/my/earnings_icon.png",
           name: "收益统计",
           pagePath: "/pages/statisticsEarnings/index",
         },
         {
-          icon: "/static/logo.png",
+          icon: "/static/image/my/shop_icon.png",
           name: "我的店铺",
           pagePath: "/pages/myShop/index",
+          badge: 10,
         },
         {
-          icon: "/static/logo.png",
+          icon: "/static/image/my/setting_icon.png",
           name: "系统设置",
           pagePath: "/pages/setting/index",
         },
       ],
     };
   },
+  computed: {},
   onLoad() {},
-  methods: {},
+  methods: {
+    badgeNum(num) {
+      return num > 99 ? "99+" : num;
+    },
+  },
 };
 </script>
 
@@ -147,8 +188,8 @@ export default {
   width: 100vw;
   height: 568rpx;
   flex-shrink: 0;
-//   background: linear-gradient(to bottom, #ffd8bf, #ffffff);
-  background:  linear-gradient(180deg, #ffd8bf 10%, #fff 65%);
+  //   background: linear-gradient(to bottom, #ffd8bf, #ffffff);
+  background: linear-gradient(180deg, #ffd8bf 10%, #fff 65%);
 
   .head {
     margin-top: 134rpx;
@@ -228,10 +269,6 @@ export default {
   }
 }
 
-.menu_item {
-  border-bottom: 2rpx solid #f2f2f7;
-}
-
 .badge {
   display: inline-flex;
   height: 40rpx;
@@ -250,4 +287,106 @@ export default {
   left: 188rpx;
   top: -20rpx;
 }
+
+.vip_year_bg {
+  margin-top: 16rpx;
+  width: 112rpx;
+  height: 44rpx;
+  background: url("/static//image/my/vip_year_bg.png");
+  background-size: cover;
+  display: flex;
+  align-items: center;
+  color: #ffffff;
+  font-family: "MiSans VF";
+  font-size: 22rpx;
+  font-weight: 500;
+  letter-spacing: 0.66rpx;
+  padding-left: 42rpx;
+}
+
+.vip_bg {
+  margin-top: 16rpx;
+  width: 144rpx;
+  height: 48rpx;
+  line-height: 40rpx;
+  background: url("/static//image/my/vip_bg.png");
+  background-size: cover;
+  padding-left: 42rpx;
+  color: #ffffff;
+  font-family: "MiSans VF";
+  font-size: 22rpx;
+  font-weight: 500;
+  letter-spacing: -0.66rpx;
+}
+
+.new_hand {
+  margin-top: 24rpx;
+  width: 100%;
+  height: 128rpx;
+  background: url("/static//image/my/new_hand_bg.png");
+  background-size: cover;
+  padding-top: 24rpx;
+  padding-left: 22rpx;
+
+  .top {
+    height: 48rpx;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+
+    .lv {
+      width: 68rpx;
+      height: 38rpx;
+      background: url("/static//image/my/grade_bg.png");
+      background-size: cover;
+      display: flex;
+      align-items: center;
+      font-size: 14rpx;
+      color: #fff;
+      padding-left: 24rpx;
+    }
+
+    .btn {
+      width: 132rpx;
+      height: 48rpx;
+      line-height: 48rpx;
+      flex-shrink: 0;
+      border-radius: 24rpx 0 0 24rpx;
+      background: linear-gradient(90deg, #ffffffcc 0%, #ffffff66 100%);
+      box-shadow: 0 8rpx 24rpx 0 #d07b1780;
+
+      color: #cc730d;
+      text-align: center;
+      font-family: "Source Han Sans CN";
+      font-size: 24rpx;
+      font-weight: 400;
+    }
+  }
+
+  .bottom {
+    display: flex;
+    align-items: center;
+    margin-top: 14rpx;
+
+    .progress_bg {
+      height: 12rpx;
+      flex-shrink: 0;
+      border-radius: 64rpx;
+      background: #ffcc91;
+    }
+
+    .progress_bar {
+      // width: 62rpx;
+      width: 0;
+      height: 12rpx;
+      // flex-shrink: 0;
+      border-radius: 64rpx 0 0 64rpx;
+      background: #cc730d;
+    }
+
+    .full_bar {
+      border-radius: 64rpx;
+    }
+  }
+}
 </style>

+ 3 - 0
static/css/fui.css

@@ -492,6 +492,9 @@ image {
 .text-70 {
 	font-size: 70rpx;
 }
+.text-88 {
+	font-size: 88rpx;
+}
 
 .text-underline {
 	text-decoration: underline;

+ 32 - 1
utils/index.js

@@ -56,4 +56,35 @@ export function isValidPassword(password) {
 	}
 
 	return true;
-}
+}
+
+/**
+ * 手机号脱敏
+ * @param {*} phone 手机号
+ * @returns 
+ */
+export function phonePrivacy(phone) {
+	if (phone) {
+		return String(phone).replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
+	} else {
+		return '';
+	}
+}
+
+/**
+ * 安全区距离
+ * @returns 顶部和底部安全距离
+ */
+export function getSafeArea() {
+	const info = uni.getSystemInfoSync()
+  
+	// 顶部安全距离(状态栏高度)
+	const top = info.statusBarHeight || 0
+  
+	// 底部安全距离(iOS 刘海屏有值,安卓一般为 0)
+	const bottom = info.safeArea
+	  ? info.screenHeight - info.safeArea.bottom
+	  : 0
+  
+	return { top, bottom }
+  }