Forráskód Böngészése

Merge branch 'main' of https://gitlab.com/tea28/client

hejie 3 éve
szülő
commit
05946bd875
4 módosított fájl, 121 hozzáadás és 184 törlés
  1. 7 7
      src/pages.json
  2. 107 174
      src/pages/account/giveAsPresent.vue
  3. 5 1
      src/pages/my/index.vue
  4. 2 2
      src/pages/partner/index.vue

+ 7 - 7
src/pages.json

@@ -93,7 +93,7 @@
 		{
 			"path": "pages/account/giveAsPresent",
 			"style": {
-				"navigationBarTitleText": "赠送"
+				"navigationBarTitleText": "茶宝赠送"
 			}
 		},
 		{
@@ -295,12 +295,12 @@
 				"selectedIconPath": "static/nav/qiandao_select.png",
 				"text": "福利"
 			},
-			// {
-			// 	"pagePath": "pages/partner/index",
-			// 	"iconPath": "static/nav/hehuoren.png",
-			// 	"selectedIconPath": "static/nav/hehuoren_select.png",
-			// 	"text": "联盟店"
-			// },
+			{
+				"pagePath": "pages/partner/index",
+				"iconPath": "static/nav/hehuoren.png",
+				"selectedIconPath": "static/nav/hehuoren_select.png",
+				"text": "联盟店"
+			},
 			{
 				"pagePath": "pages/my/index",
 				"iconPath": "static/nav/wode.png",

+ 107 - 174
src/pages/account/giveAsPresent.vue

@@ -1,202 +1,135 @@
 <template>
-  <view class="container">
-    <!-- 顶部 -->
-    <view class="head flex_r flex_ac flex_jb">
-      <input
-        class="head_input"
-        type="number"
-        v-model="id"
-        placeholder="输入对方账号"
-      />
-      <view class="hea_text">茶宝赠送</view>
+    <view class="container">
+        <view class="list flex_r flex_ac flex_jb mar_t16">
+            <view class="list_name">当前茶宝余额:</view>
+            <view class="list_text flex_r flex_ac flex_je">{{ userinfo.cha_bao }}</view>
+        </view>
+        <view class="list flex_r flex_ac flex_jb mar_t16">
+            <view class="list_name">对方账号:</view>
+            <view class="list_text flex_r flex_ac">
+                <input type="text" v-model="id" placeholder="输入对方账号" placeholder-style="color:#ddd;" />
+            </view>
+        </view>
+        <view class="list flex_r flex_ac flex_jb mar_t16">
+            <view class="list_name">赠送数量:</view>
+            <view class="list_text flex_r flex_ac">
+                <input type="text" v-model="give_num" placeholder="自定义赠送数量" placeholder-style="color:#ddd;" />
+            </view>
+        </view>
+        <view class="btn flex_r flex_ac flex_jc" @tap="giveIntegral">立即赠送</view>
     </view>
-    <!-- 顶部-end -->
-
-    <!-- 赠送 -->
-    <view class="give">
-      <view class="give_option flex_r flex_ac flex_jb"
-        ><text class="flex_r flex_ac">赠送数量</text>
-        <input
-          type="number"
-          v-model="give_num"
-          placeholder="自定义赠送数量"
-          placeholder-style="color:#989898;"
-        />
-      </view>
-      <!-- <view class="give_con flex_r flex_ac flex_wrap">
-				<view class="give_list flex_c flex_ac" v-for="(item,index) in list" :key="index" @tap="setCurren(item.integralType)">
-					<view class="give_label flex_r flex_ac flex_jc" :class="curren == item.integralType ? 'actice' : ''" @tap="setCurren(item.integralType)">{{item.integralName}}</view>
-					<view class="give_number flex_r flex_ac flex_jc">{{curren == item.integralType ? '剩余(' + surplus + ')' : ''}}</view>
-				</view>
-			</view> -->
-    </view>
-    <!-- 赠送-end -->
-
-    <!-- 确定赠送 -->
-    <view class="btn flex_r flex_ac flex_jc" @tap="giveIntegral">确定</view>
-    <!-- 确定赠送-end -->
-  </view>
 </template>
-
 <script>
 let page = 1;
 let app = getApp();
 var appEv = app.$vm.$options;
 import { get, post } from "@/request/api.js";
 export default {
-  data() {
-    return {
-      id: "",
-      give_num: "",
-      curren: 1,
-      surplus: 0,
-      list: [],
-      userinfo: undefined, // 获取用户信息
-    };
-  },
-  onLoad () {
-    this.userinfo = uni.getStorageSync("userinfo");
-  },
-  methods: {
-    setCurren(e) {
-      this.surplus = 0;
-      this.curren = e;
-      this.giveUserIntegral();
-    },
-    // 赠送
-    giveIntegral() {
-      if (this.give_num == 0) {
-        appEv.errTips("赠送数量不得为0");
-        return;
-      } else if (this.give_num > Number(this.userinfo.cha_bao)) {
-        appEv.errTips("赠送数量不得超过茶宝余额");
-        return;
-      } else if (this.id == "") {
-        appEv.errTips("请输入赠送账号");
-        return;
-      } else {
-        let data = {
-          mobile: this.id,
-          number: this.give_num,
+    data() {
+        return {
+            id: "",
+            give_num: "",
+            curren: 1,
+            surplus: 0,
+            list: [],
+            userinfo: undefined, // 获取用户信息
         };
-        post("my/give", data).then((res) => {
-          if (res.code === 0) {
-            this.give_num = 0;
-			this.id = ''
-            appEv.errTips(res.msg);
-          } else {
-            appEv.errTips(res.msg);
-          }
-        });
-      }
     },
-  },
+    onLoad() {
+        this.userinfo = uni.getStorageSync("userinfo");
+    },
+    methods: {
+        setCurren(e) {
+            this.surplus = 0;
+            this.curren = e;
+            this.giveUserIntegral();
+        },
+        // 赠送
+        giveIntegral() {
+            if (this.give_num == 0) {
+                appEv.errTips("赠送数量不得为0");
+                return;
+            } else if (this.give_num > Number(this.userinfo.cha_bao)) {
+                appEv.errTips("赠送数量不得超过茶宝余额");
+                return;
+            } else if (this.id == "") {
+                appEv.errTips("请输入赠送账号");
+                return;
+            } else {
+                let data = {
+                    mobile: this.id,
+                    number: this.give_num,
+                };
+                post("my/give", data).then((res) => {
+                    if (res.code === 0) {
+                        this.give_num = 0;
+                        this.id = ''
+                        appEv.errTips(res.msg);
+                    } else {
+                        appEv.errTips(res.msg);
+                    }
+                });
+            }
+        },
+    },
 };
 </script>
-
 <style lang="scss">
 // 页面配置
-.container {
-  border-top: 16rpx solid #f4f4f4;
+page {
+    background: #f4f4f4;
 }
+
 // 页面配置-end
 
-// 顶部
-.hea_text {
-  font-size: 32rpx;
-  color: #404040;
-  font-family: "SourceHanSansCN-Medium";
-}
-.head_input {
-  width: 500rpx;
-  height: 64rpx;
-  background: #ebebeb;
-  padding: 0 40rpx;
-  box-sizing: border-box;
-}
-.head {
-  width: 100%;
-  height: 147rpx;
-  padding: 40rpx 30rpx;
-  box-sizing: border-box;
-  border-bottom: 3rpx solid #f4f4f4;
-}
-// 顶部-end
 
-// 赠送
-.give_con {
-  width: 100%;
-}
-.give_option {
-  height: 70rpx;
-}
-.give_list:nth-child(3n) {
-  margin-right: 0;
-}
-.give_list {
-  width: calc((100% - 60rpx) / 3);
-  margin-right: 30rpx;
+.list {
+    width: 100%;
+    height: 86rpx;
+    padding: 0 30rpx;
+    box-sizing: border-box;
+    background: #fff;
 }
-.give {
-  width: 100%;
-  overflow: hidden;
-  padding: 0 30rpx;
-  box-sizing: border-box;
-}
-.give_option text {
-  width: 116rpx;
-  font-size: 26rpx;
-  color: #404040;
-  font-family: "SourceHanSansCN-Medium";
-  height: 100%;
-  box-sizing: border-box;
-}
-.give_number {
-  font-size: 24rpx;
-  color: #17bb87;
-  font-family: "SourceHanSansCN-Medium";
-  height: 58rpx;
-  width: 100%;
+
+.list_text {
+    flex: 1;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
+    font-size: 36rpx;
+    color: #17bb87;
 }
-.give_option input {
-  width: calc(100% - 136rpx);
-  margin-left: 20rpx;
-  // font-size: 34rpx;
-  font-family: "SourceHanSansCN-Bold";
-  font-weight: bold;
-  color: #17bb87;
-  height: 100%;
-  background: #ebebeb;
-  padding: 0 40rpx;
-  box-sizing: border-box;
+
+.list_name {
+    flex: 1;
+    color: #333333;
+    font-size: 28rpx;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: 500;
 }
-.give_label {
-  width: 100%;
-  height: 70rpx;
-  background: #efefef;
-  color: #7d7d7d;
-  font-family: "SourceHanSansCN-Medium";
-  font-size: 28rpx;
-  border-radius: 4rpx;
+
+.list_text input {
+    font-size: 28rpx;
+    color: #333333;
+    text-align: right;
+    margin-left: 20rpx;
 }
 
-.actice {
-  background: #18bb87;
-  box-shadow: 0px 10rpx 16rpx 0px rgba(23, 187, 135, 0.6);
-  color: #fff;
+.list_text text {
+    font-family: "SourceHanSansCN-Medium";
+    font-size: 22rpx;
+    font-weight: 500rpx;
+    color: #17bb87;
 }
-// 赠送-end
 
-// 赠送按钮
 .btn {
-  width: 369rpx;
-  height: 72rpx;
-  border-radius: 8rpx;
-  color: #fff;
-  background: #18bb87;
-  font-size: 38rpx;
-  font-family: "SourceHanSansCN-Medium";
-  margin: 170rpx auto 0;
+    width: 689rpx;
+    height: 92rpx;
+    background: #17bb87;
+    color: #fff;
+    font-size: 42rpx;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: 500;
+    margin: 132rpx auto 0;
+    border-radius: 10rpx;
 }
-// 赠送按钮-end
-</style>
+</style>

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

@@ -29,7 +29,7 @@
 							<view class="copy_account flex_r flex_ac flex_jc" @tap="copyText(userinfo.mobile)">复制</view>
 						</view>
 					</view>
-					<view class="user_option flex_r flex_ac">
+					<view class="user_option flex_r flex_ac flex_je">
 						<image class="code_img" src="/static/my/f_img_code.png" @tap="getImgPage" mode=""></image>
 						<!-- <image class="code_img" src="/static/my/setting.png" @tap="getToSetting"></image> -->
 					</view>
@@ -611,6 +611,10 @@
 		line-height: 1;
 	}
 
+	.user_option {
+		width: 140rpx;
+		text-align: right;
+	}
 	// 用户信息-end
 
 	// 账户信息

+ 2 - 2
src/pages/partner/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class='partner'>
-    <img src="@/static/img/upcoming.png" class="upcoming" alt="" srcset="">
+    <img src="@/static/img/upcoming.png" mode="widthFix" class="upcoming" alt="" srcset="">
   </div>
 </template>
 <script>
@@ -22,7 +22,7 @@ export default {
 <style scoped lang='scss'>
 .upcoming{
   width: 330rpx;
-  height: 190rpx;
+  // height: 190rpx;
   margin-left: calc(50% - 330rpx / 2);
   margin-top: 30vh;
 }