|
@@ -1,129 +1,198 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view class="container">
|
|
|
|
|
- <!-- 顶部 -->
|
|
|
|
|
- <view class="head flex_r flex_ac flex_jb">
|
|
|
|
|
- <input class="head_input" type="text" v-model="id" placeholder="输入对方账号" />
|
|
|
|
|
- <view class="hea_text">积分赠送</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- 顶部-end -->
|
|
|
|
|
-
|
|
|
|
|
- <!-- 赠送 -->
|
|
|
|
|
- <view class="give">
|
|
|
|
|
- <view class="give_option flex_r flex_ac"><text class="flex_r flex_ac">赠送数量</text>
|
|
|
|
|
- <input type="text" v-model="give_num" placeholder="自定义赠送数量" placeholder-style="color:#989898;" />
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="give_con flex_r flex_ac flex_wrap">
|
|
|
|
|
|
|
+ <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>
|
|
|
|
|
+ <!-- 顶部-end -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 赠送 -->
|
|
|
|
|
+ <view class="give">
|
|
|
|
|
+ <view class="give_option flex_r flex_ac"
|
|
|
|
|
+ ><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_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_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 class="give_number flex_r flex_ac flex_jc">{{curren == item.integralType ? '剩余(' + surplus + ')' : ''}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- 赠送-end -->
|
|
|
|
|
-
|
|
|
|
|
- <!-- 确定赠送 -->
|
|
|
|
|
- <view class="btn flex_r flex_ac flex_jc" @tap="giveIntegral">确定</view>
|
|
|
|
|
- <!-- 确定赠送-end -->
|
|
|
|
|
- </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;
|
|
|
// let reqApi = new ReqApi();
|
|
// let reqApi = new ReqApi();
|
|
|
// import { ReqApi } from "@/utils/reqTools.js";
|
|
// import { ReqApi } from "@/utils/reqTools.js";
|
|
|
import { get, post, u_post } from "@/request/api.js";
|
|
import { get, post, u_post } from "@/request/api.js";
|
|
|
- export default {
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- id:'',
|
|
|
|
|
- give_num:'',
|
|
|
|
|
- curren:1,
|
|
|
|
|
- surplus:0,
|
|
|
|
|
- list:[]
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- onLoad:function(){
|
|
|
|
|
- this.loadData()
|
|
|
|
|
- },
|
|
|
|
|
- methods:{
|
|
|
|
|
- // 获取用户积分
|
|
|
|
|
- loadData:function(){
|
|
|
|
|
- let that = this;
|
|
|
|
|
- post("ShuZiTeaIntegral/integral/getGiveIntegral").then(res => {
|
|
|
|
|
- if(res.status == 200){
|
|
|
|
|
- that.list = res.data
|
|
|
|
|
- // that.curren = list[0].integralType
|
|
|
|
|
- that.giveUserIntegral()
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- giveUserIntegral:function(){
|
|
|
|
|
- let that = this;
|
|
|
|
|
- let data = {
|
|
|
|
|
- type:this.curren
|
|
|
|
|
- }
|
|
|
|
|
- u_post("ShuZiTeaIntegral/integral/giveUserIntegral",data).then(res => {
|
|
|
|
|
- if(res.status == 200){
|
|
|
|
|
- that.surplus = res.integral
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- setCurren:function(e){
|
|
|
|
|
- this.surplus = 0;
|
|
|
|
|
- this.curren = e;
|
|
|
|
|
- this.giveUserIntegral();
|
|
|
|
|
- },
|
|
|
|
|
- // 赠送
|
|
|
|
|
- giveIntegral:function(){
|
|
|
|
|
- let that = this;
|
|
|
|
|
- let data = {
|
|
|
|
|
- type:this.curren,
|
|
|
|
|
- giveIntegral:this.give_num,
|
|
|
|
|
- userAccount:this.id
|
|
|
|
|
- }
|
|
|
|
|
- u_post("ShuZiTeaIntegral/integral/giveIntegral",data).then(res => {
|
|
|
|
|
- if(res.status == 200){
|
|
|
|
|
- that.give_num = 0;
|
|
|
|
|
- that.surplus = res.integral
|
|
|
|
|
- that.giveUserIntegral()
|
|
|
|
|
- appEv.errTips(res.msg)
|
|
|
|
|
- }else{
|
|
|
|
|
- appEv.errTips(res.msg)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+export default {
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ id: "",
|
|
|
|
|
+ give_num: "",
|
|
|
|
|
+ curren: 1,
|
|
|
|
|
+ surplus: 0,
|
|
|
|
|
+ list: [],
|
|
|
|
|
+ userinfo: undefined, // 获取用户信息
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoad: function () {
|
|
|
|
|
+ this.userinfo = uni.getStorageSync("userinfo");
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ setCurren: function (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;}
|
|
|
|
|
|
|
+.container {
|
|
|
|
|
+ border-top: 16rpx solid #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;}
|
|
|
|
|
|
|
+.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
|
|
// 顶部-end
|
|
|
|
|
|
|
|
// 赠送
|
|
// 赠送
|
|
|
-.give_con{width: 100%;}
|
|
|
|
|
-.give_option{height: 88rpx;}
|
|
|
|
|
-.give_list:nth-child(3n){margin-right: 0;}
|
|
|
|
|
-.give_list{width:calc((100% - 60rpx) / 3);margin-right: 30rpx;}
|
|
|
|
|
-.give{width: 100%;overflow: hidden;padding:0 30rpx;box-sizing: border-box;}
|
|
|
|
|
-.give_option text{font-size: 26rpx;color:#404040;font-family: "SourceHanSansCN-Medium";height: 100%;}
|
|
|
|
|
-.give_number{font-size: 24rpx;color:#17BB87;font-family: "SourceHanSansCN-Medium";height: 58rpx;width: 100%;}
|
|
|
|
|
-.give_option input{margin-left: 20rpx;font-size: 34rpx;font-family: "SourceHanSansCN-Bold";font-weight: bold;color:#17BB87;height: 100%;}
|
|
|
|
|
-.give_label{width: 100%;height: 70rpx;background: #EFEFEF;color:#7D7D7D;font-family: "SourceHanSansCN-Medium";font-size: 28rpx;border-radius: 4rpx;}
|
|
|
|
|
|
|
+.give_con {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+.give_option {
|
|
|
|
|
+ height: 88rpx;
|
|
|
|
|
+}
|
|
|
|
|
+.give_list:nth-child(3n) {
|
|
|
|
|
+ margin-right: 0;
|
|
|
|
|
+}
|
|
|
|
|
+.give_list {
|
|
|
|
|
+ width: calc((100% - 60rpx) / 3);
|
|
|
|
|
+ margin-right: 30rpx;
|
|
|
|
|
+}
|
|
|
|
|
+.give {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ padding: 0 30rpx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+}
|
|
|
|
|
+.give_option text {
|
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
|
+ color: #404040;
|
|
|
|
|
+ font-family: "SourceHanSansCN-Medium";
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+.give_number {
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ color: #17bb87;
|
|
|
|
|
+ font-family: "SourceHanSansCN-Medium";
|
|
|
|
|
+ height: 58rpx;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+.give_option input {
|
|
|
|
|
+ margin-left: 20rpx;
|
|
|
|
|
+ font-size: 34rpx;
|
|
|
|
|
+ font-family: "SourceHanSansCN-Bold";
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ color: #17bb87;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+.give_label {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 70rpx;
|
|
|
|
|
+ background: #efefef;
|
|
|
|
|
+ color: #7d7d7d;
|
|
|
|
|
+ font-family: "SourceHanSansCN-Medium";
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ border-radius: 4rpx;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-.actice{background: #18BB87;box-shadow: 0px 10rpx 16rpx 0px rgba(23, 187, 135, 0.6);color:#fff;}
|
|
|
|
|
|
|
+.actice {
|
|
|
|
|
+ background: #18bb87;
|
|
|
|
|
+ box-shadow: 0px 10rpx 16rpx 0px rgba(23, 187, 135, 0.6);
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+}
|
|
|
// 赠送-end
|
|
// 赠送-end
|
|
|
|
|
|
|
|
// 赠送按钮
|
|
// 赠送按钮
|
|
|
-.btn{width: 369rpx;height: 72rpx;border-radius: 8rpx;color:#fff;background: #18BB87;font-size: 38rpx;font-family: "SourceHanSansCN-Medium";margin: 170rpx auto 0;}
|
|
|
|
|
|
|
+.btn {
|
|
|
|
|
+ width: 369rpx;
|
|
|
|
|
+ height: 72rpx;
|
|
|
|
|
+ border-radius: 8rpx;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ background: #18bb87;
|
|
|
|
|
+ font-size: 38rpx;
|
|
|
|
|
+ font-family: "SourceHanSansCN-Medium";
|
|
|
|
|
+ margin: 170rpx auto 0;
|
|
|
|
|
+}
|
|
|
// 赠送按钮-end
|
|
// 赠送按钮-end
|
|
|
</style>
|
|
</style>
|