|
@@ -1,202 +1,135 @@
|
|
|
<template>
|
|
<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>
|
|
</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>
|
|
</template>
|
|
|
-
|
|
|
|
|
<script>
|
|
<script>
|
|
|
let page = 1;
|
|
let page = 1;
|
|
|
let app = getApp();
|
|
let app = getApp();
|
|
|
var appEv = app.$vm.$options;
|
|
var appEv = app.$vm.$options;
|
|
|
import { get, post } from "@/request/api.js";
|
|
import { get, post } from "@/request/api.js";
|
|
|
export default {
|
|
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>
|
|
</script>
|
|
|
-
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
// 页面配置
|
|
// 页面配置
|
|
|
-.container {
|
|
|
|
|
- border-top: 16rpx solid #f4f4f4;
|
|
|
|
|
|
|
+page {
|
|
|
|
|
+ background: #f4f4f4;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 页面配置-end
|
|
// 页面配置-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 {
|
|
.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>
|