Răsfoiți Sursa

修改问题

hejie 3 ani în urmă
părinte
comite
4c853a0830

+ 18 - 0
src/pages.json

@@ -185,6 +185,24 @@
 			"style": {
 				"navigationBarTitleText": "茶宝明细"
 			}
+		},
+		{
+			"path": "pages/my-tea-list/index",
+			"style": {
+				"navigationBarTitleText": "我的茶友"
+			}
+		},
+		{
+			"path": "pages/tea-list/index",
+			"style": {
+				"navigationBarTitleText": "我的茶友"
+			}
+		},
+		{
+			"path": "pages/tea-rule/index",
+			"style": {
+				"navigationBarTitleText": "茶友等级介绍"
+			}
 		}
 	],
 	"tabBar": {

+ 416 - 0
src/pages/my-tea-list/index.vue

@@ -0,0 +1,416 @@
+<template>
+  <view class="container">
+    <!-- 顶部 -->
+    <view class="head">
+      <view class="head_info flex_r flex_ac flex_jb">
+        <view class="flex_grow flex_r flex_ac">
+          <image class="head_img" :src="higherInfo.head_pic" mode=""></image>
+          <view class="flex_c flex_grow">
+            <view class="userInfo flex_r flex_ac">
+              <view class="user_name">{{ higherInfo.nickname }}</view>
+              <!-- <view class="level flex_r flex_ac flex_jc">{{
+                higherInfo.higherUp
+              }}</view> -->
+            </view>
+            <view class="flex_r flex_ac mar_t16">
+              <view class="account">{{ higherInfo.mobile || "" }}</view>
+              <view class="copyBalance" @tap="copyAccount(higherInfo.mobile)"
+                >复制</view
+              >
+            </view>
+          </view>
+        </view>
+        <view class="head_option flex_r flex_ac">
+          <!-- <image
+            class="option_weixin"
+            src="/static/weixin.png"
+            mode=""
+            @tap="copyText"
+          ></image> -->
+          <view class="option_hr"></view>
+          <image
+            class="option_phone"
+            src="/static/dianhua.png"
+            mode=""
+            @tap="dial(higherInfo.mobile)"
+          ></image>
+        </view>
+      </view>
+      <view class="head_time flex_r flex_ac"
+        >注册时间:{{ $day(higherInfo.reg_time * 1000).format('YYYY-MM-DD HH:mm:ss') }}</view
+      >
+    </view>
+    <!-- 顶部-end -->
+
+    <!-- 茶友数量 -->
+    <view class="tea_con mar_t30">
+      <view class="tea_total flex_r flex_ac flex_jc">
+        <view class="total_con flex_c flex_ac flex_jc">
+          <view class="total_num"
+            >{{ myQuanTeaFriendNum || 0 }}<text>人</text></view
+          >
+          <view class="total_text">茶友总数</view>
+        </view>
+      </view>
+      <view class="tea_info flex_r flex_ac">
+        <view
+          class="info_list flex_c flex_ac flex_jc borRight"
+          @tap="getToTeaList"
+        >
+          <view class="list_num">{{ myTeaFriendNum || 0 }}<text>人</text></view>
+          <view class="list_text">我的茶友</view>
+        </view>
+        <view class="info_list flex_c flex_ac flex_jc">
+          <view class="list_num"
+            >{{ myZhuanTeaFriendNum || 0 }}<text>人</text></view
+          >
+          <view class="list_text">转介绍茶友</view>
+        </view>
+      </view>
+    </view>
+    <!-- 茶友数量-end -->
+
+    <!-- <view class="setBtn flex_r flex_ac flex_jc" @tap="setContact"
+      >设置联系方式</view
+    > -->
+
+    <!-- 设置联系方式 -->
+    <popup ref="popup" type="center">
+      <view class="msg_con">
+        <view class="msg_head flex_r flex_ac flex_jb">
+          <view class="msg_title">填写信息</view>
+          <image
+            class="msg_close"
+            src="/static/cuowu_icon.png"
+            mode=""
+            @tap="closePopup"
+          ></image>
+        </view>
+        <view class="from">
+          <view class="from_list">
+            <input type="text" v-model="wxcode" placeholder="请输入微信号" />
+          </view>
+          <view class="from_list">
+            <input type="text" v-model="mobile" placeholder="请输入手机号" />
+          </view>
+          <view class="confimBtn flex_r flex_ac flex_jc" @tap="setUserInfo"
+            >提交</view
+          >
+        </view>
+      </view>
+    </popup>
+    <!-- 设置联系方式-end -->
+  </view>
+</template>
+
+<script>
+let app = getApp();
+// let reqApi = new ReqApi();
+var appEv = app.$vm.$options;
+// import { ReqApi } from "@/utils/reqTools.js";
+// import uniCopy from "@/js_sdk/xb-copy/uni-copy.js";
+import uniCopy from "../../utils/copy";
+import popup from "@/components/uni-popup/uni-popup.vue";
+import { post } from "@/request/api.js";
+export default {
+  components: {
+    popup,
+  },
+  data() {
+    return {
+      higherInfo: "",
+      myTeaFriendNum: "",
+      myZhuanTeaFriendNum: "",
+      myQuanTeaFriendNum: "",
+      wxcode: "",
+      mobile: "",
+    };
+  },
+  onLoad: function () {
+    this.loadData();
+  },
+  methods: {
+    loadData() {
+      post("/my/chayou").then((res) => {
+        if (res.code === 0) {
+          this.higherInfo = res.data.data.superior;
+          this.myTeaFriendNum = res.data.data.below;
+          this.myZhuanTeaFriendNum = res.data.data.lower_level;
+          this.myQuanTeaFriendNum =
+            res.data.data.below + res.data.data.lower_level;
+        }
+      });
+    },
+    // 填写我的信息
+    setUserInfo: function () {
+      let that = this;
+      let data = {
+        phone: this.mobile,
+        wxNumber: this.wxcode,
+      };
+      const info = reqApi.setUserInfo(data);
+      if (info) {
+        info.then((res) => {
+          if (res.data.status == 200) {
+            appEv.errTips(res.data.msg);
+            that.$refs.popup.close();
+            that.mobile = "";
+            that.wxcode = "";
+          } else {
+            appEv.errTips(res.data.msg);
+          }
+        });
+      }
+    },
+    // 复制微信号
+    copyText: function () {
+      let that = this;
+      if (that.higherInfo.higherNumber == "") {
+        appEv.errTips("用户暂未设置微信");
+        return false;
+      }
+      uniCopy({
+        content: that.higherInfo.higherNumber,
+        success: (res) => {},
+        error: (e) => {},
+      });
+    },
+    // 复制账号
+    copyAccount: function (e) {
+      uniCopy({
+        content: e,
+        success: (res) => {},
+        error: (e) => {},
+      });
+    },
+    // 设置联系方式
+    setContact: function () {
+      let that = this;
+      that.$refs.popup.open();
+    },
+    // 关闭窗口
+    closePopup: function () {
+      this.$refs.popup.close();
+    },
+    // 跳转到我的茶友列表
+    getToTeaList: function () {
+      uni.navigateTo({
+        url: "/pages/tea-list/index",
+      });
+    },
+    // 拨打电话
+    dial: function (e) {
+      let that = this;
+      if (that.higherInfo.higherPhone == "") {
+        appEv.errTips("用户暂未设置电话");
+        return false;
+      }
+      uni.makePhoneCall({
+        phoneNumber: e, //仅为示例
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+page {
+  background: #f5f5f5;
+}
+// 页面配置
+.container {
+  padding: 20rpx 30rpx;
+  box-sizing: border-box;
+}
+// 页面配置-end
+
+// 顶部
+.account {
+  font-size: 24rpx;
+  color: #7f7f7f;
+}
+.option_weixin {
+  width: 42rpx;
+  height: 35rpx;
+}
+.option_phone {
+  width: 36rpx;
+  height: 36rpx;
+  margin-left: 30rpx;
+}
+.user_name {
+  font-size: 30rpx;
+  color: #363638;
+  margin-right: 12rpx;
+}
+.head {
+  width: 100%;
+  overflow: hidden;
+  border-radius: 4rpx;
+  background: #fff;
+}
+.head_img {
+  width: 79rpx;
+  height: 79rpx;
+  margin-right: 30rpx;
+  border-radius: 50%;
+}
+.option_hr {
+  width: 3rpx;
+  height: 66rpx;
+  background: rgba(0, 0, 0, 0.12);
+  margin-left: 30rpx;
+}
+.copyBalance {
+  padding: 0 10rpx;
+  background: #1cbe8c;
+  color: #fff;
+  font-size: 22rpx;
+  margin-left: 12rpx;
+}
+.level {
+  width: 74rpx;
+  height: 26rpx;
+  background: #1cbe8c;
+  color: #fff;
+  font-size: 20rpx;
+  line-height: 1;
+}
+.head_time {
+  width: 100%;
+  height: 94rpx;
+  padding: 0 24rpx;
+  box-sizing: border-box;
+  font-size: 22rpx;
+  color: #606060;
+}
+.head_info {
+  width: 100%;
+  overflow: hidden;
+  padding: 40rpx 24rpx 60rpx;
+  box-sizing: border-box;
+  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+}
+// 顶部-end
+
+// 茶友数量
+.list_num {
+  font-size: 36rpx;
+  color: #1cbe8c;
+}
+.total_num {
+  font-size: 40rpx;
+  color: #232323;
+}
+.list_text {
+  font-size: 22rpx;
+  color: #606060;
+}
+.list_num text {
+  font-size: 24rpx;
+  color: #1cbe8c;
+}
+.total_num text {
+  font-size: 24rpx;
+  color: #232323;
+}
+.borRight {
+  border-right: 3rpx solid rgba(0, 0, 0, 0.12);
+}
+.info_list {
+  height: 100%;
+  width: 50%;
+  box-sizing: border-box;
+}
+.total_text {
+  font-size: 22rpx;
+  color: #606060;
+  margin-top: 12rpx;
+}
+.tea_con {
+  width: 100%;
+  overflow: hidden;
+  border-radius: 8rpx;
+  background: #fff;
+}
+.tea_info {
+  width: 100%;
+  height: 156rpx;
+  padding: 16rpx 0;
+  box-sizing: border-box;
+}
+.tea_total {
+  width: 100%;
+  height: 260rpx;
+  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+}
+.total_con {
+  width: 164rpx;
+  height: 164rpx;
+  border: 6rpx solid #1cbe8c;
+  border-radius: 50%;
+}
+// 茶友数量-end
+
+// 设置联系方式
+.setBtn {
+  width: 100%;
+  height: 83rpx;
+  background: #1cbe8c;
+  color: #ffffff;
+  font-size: 36rpx;
+  border-radius: 4rpx;
+  margin-top: 128rpx;
+}
+// 设置联系方式-end
+
+// 设置联系方式弹窗
+.msg_close {
+  width: 31rpx;
+  height: 31rpx;
+}
+.msg_title {
+  font-size: 28rpx;
+  color: #252525;
+}
+.from_list input {
+  width: 100%;
+  height: 100%;
+}
+.msg_con {
+  width: 650rpx;
+  overflow: hidden;
+  border-radius: 12rpx;
+  background: #fff;
+}
+.from {
+  width: 100%;
+  overflow: hidden;
+  padding: 24rpx 30rpx;
+  box-sizing: border-box;
+}
+.confimBtn {
+  width: 100%;
+  height: 60rpx;
+  background: #1cbe8c;
+  color: #ffffff;
+  font-size: 34rpx;
+}
+.msg_head {
+  width: 100%;
+  height: 88rpx;
+  padding: 0 30rpx;
+  box-sizing: border-box;
+  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+}
+.from_list {
+  width: 100%;
+  height: 60rpx;
+  padding: 0 30rpx;
+  box-sizing: border-box;
+  border-radius: 2rpx;
+  margin-bottom: 24rpx;
+  background: #efefef;
+}
+// 设置联系方式弹窗-end
+</style>

+ 4 - 1
src/pages/my/index.vue

@@ -400,7 +400,10 @@
 			},
 			// 未开放提示信息
 			SetHint: function() {
-				appEv.errTips("此功能暂未开放");
+				uni.navigateTo({
+					url: "/pages/tea-rule/index",
+				});
+				
 			},
 
 			// 跳转到分享页面

+ 1 - 1
src/pages/sign/index.vue

@@ -54,7 +54,7 @@
                 </view>
             </view>
         </view>
-        <view class='fz_w_text mar_b20 mar_t20'>茶,让生活更美好!</view>
+        <view class='fz_w_text mar_b20 mar_t20'>让数字经济赋能美好生活!</view>
         <!-- 精品推荐-end -->
 
         <!-- 兑换弹窗 -->

+ 149 - 0
src/pages/tea-list/index.vue

@@ -0,0 +1,149 @@
+<template>
+  <view class="container">
+    <view
+      class="list flex_r flex_ac"
+      v-for="(item, index) in list"
+      :key="index"
+    >
+      <image class="head_img" :src="item.head_pic" mode=""></image>
+      <view class="tea_info flex_grow flex_c">
+        <view class="tea_name">{{ item.nickname }}</view>
+        <view class="balance flex_r flex_ac"
+          >{{ item.mobile }}
+          <view class="copyBalance" @tap="copyText(item.mobile)"
+            >复制</view
+          ></view
+        >
+      </view>
+      <view class="head_option flex_r flex_ac">
+        <!-- <image
+          class="option_weixin"
+          src="/static/weixin.png"
+          mode=""
+          @tap="copyText(item.wxNumber)"
+        ></image> -->
+        <view class="option_hr"></view>
+        <image
+          class="option_phone"
+          src="/static/dianhua.png"
+          mode=""
+          @tap="dial(item.mobile)"
+        ></image>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+let page = 1;
+let app = getApp();
+// let reqApi = new ReqApi();
+var appEv = app.$vm.$options;
+import uniCopy from "../../utils/copy";
+// import { ReqApi } from "@/utils/reqTools.js";
+// import uniCopy from "@/js_sdk/xb-copy/uni-copy.js";
+import { post } from "@/request/api.js";
+export default {
+  data() {
+    return {
+      list: [], // 我的茶友列表
+    };
+  },
+  onShow() {
+    this.loadData();
+  },
+  methods: {
+    loadData() {
+        post('/my/mychayou').then(res => {
+            if(res.code === 0){
+                this.list = res.data.data
+            }
+        })
+    },
+    // 拨打电话
+    dial: function (e) {
+      let that = this;
+      if (e == "") {
+        appEv.errTips("用户暂未设置电话");
+        return false;
+      }
+      uni.makePhoneCall({
+        phoneNumber: e, //仅为示例
+      });
+    },
+    // 复制微信号
+    copyText: function (e) {
+      let that = this;
+      if (e == "") {
+        appEv.errTips("用户暂未设置微信");
+        return false;
+      }
+      uniCopy({
+        content: e,
+        success: (res) => {},
+        error: (e) => {},
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+// 页面配置
+.container {
+  border-top: 20rpx solid #f5f5f5;
+}
+// 页面配置-end
+
+// 我的茶友列表
+.tea_name {
+  font-size: 30rpx;
+  color: #363638;
+}
+.option_weixin {
+  width: 42rpx;
+  height: 35rpx;
+}
+.balance {
+  font-size: 28rpx;
+  color: #18bb88;
+  margin-top: 6rpx;
+}
+.option_phone {
+  width: 36rpx;
+  height: 36rpx;
+  margin-left: 30rpx;
+}
+.tea_level {
+  font-size: 26rpx;
+  color: #6c6c6c;
+  margin-top: 12rpx;
+}
+.head_img {
+  width: 79rpx;
+  height: 79rpx;
+  margin-right: 40rpx;
+  border-radius: 50%;
+}
+.option_hr {
+  width: 3rpx;
+  height: 66rpx;
+  background: rgba(0, 0, 0, 0.12);
+  margin-left: 30rpx;
+}
+.copyBalance {
+  padding: 0 10rpx;
+  background: #1cbe8c;
+  color: #fff;
+  font-size: 22rpx;
+  margin-left: 12rpx;
+}
+.list {
+  width: 100%;
+  height: 130rpx;
+  box-sizing: border-box;
+  padding: 0 36rpx;
+  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+}
+// 我的茶友列表-end
+</style>

+ 49 - 0
src/pages/tea-rule/index.vue

@@ -0,0 +1,49 @@
+<template>
+	<view class="container">
+		<!-- 用户须知 -->
+		<jyf-parser :html="content" class="mar_t50"></jyf-parser>
+		<!-- 用户须知-end -->
+	</view>
+</template>
+
+<script>
+let app=getApp();
+// let reqApi = new ReqApi();
+var appEv = app.$vm.$options;
+import { post } from "@/request/api.js";
+import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
+// import { ReqApi } from "@/utils/reqTools.js";
+	export default {
+		data() {
+			return {
+				content:''
+			};
+		},
+		onLoad(){
+			this.loadData()
+		},
+		methods:{
+			loadData(){
+				let data = {
+					type:4
+				}
+				post("/my/article",data).then(res => {
+				  if (res.code == 0) {
+				    this.content = res.data.data.content
+					console.log(this.content)
+				    // this.BannerImg = res.list;
+				  }
+				}); 
+			}
+		},
+		components:{
+					jyfParser
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+// 用户须知
+.container{border-top: 20rpx solid #f5f5f5;padding: 0 20rpx;box-sizing: border-box;}
+// 用户须知-end
+</style>

BIN
src/static/dianhua.png


BIN
src/static/weixin.png