123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- <template>
- <view>
- <form :style="colorStyle">
- <view class="payment-top acea-row row-column row-center-wrapper">
- <span class="name">我的消费分</span>
- <view class="pic">
- <span class="pic-font">{{userinfo.integral || 0.00}}</span>
- </view>
- </view>
- <view class="payment">
- <view class="tip picList">
- <view class='to_uid acea-row row-between'>
- <view class="title">转账数量</view>
- <input class="uidbox" v-model="number" placeholder="0.00"
- type='number' placeholder-class='placeholderUid' name="number"></input>
- </view>
- <view class='to_uid acea-row row-between'>
- <view class="title">用户UID</view>
- <input class="uidbox" placeholder-class='placeholderUid' placeholder="请输入转入的用户uid" v-model="uid" type='number' name="uid"></input>
-
- <image @click="qr" class="tipimg" src="../../../static/images/qrSq.png" mode=""></image>
-
- </view>
- </view>
- <view class="tips-title" v-if="userinfo.shop_integral_trade_commission">
- <view style="font-weight: bold; font-size: 26rpx;">提示:</view>
- <view style="margin-top: 10rpx;">当前手续费为 <text
- class='font-color'>{{userinfo.shop_integral_trade_commission*number/100}}</text></view>
- </view>
- <button class='but bg-color' @click="submitSub"> 立即转换</button>
- </view>
- </form>
- <home v-if="navigation"></home>
-
-
-
-
- </view>
- </template>
- <script>
- import {
- getUserInfo,
- integralTrade
- } from '@/api/user.js';
- import {
- toLogin
- } from '@/libs/login.js';
- import {
- mapGetters
- } from "vuex";
- import home from '@/components/home';
- import colors from "@/mixins/color";
- export default {
- components: {
- home,
- },
- mixins: [colors],
- data() {
- let that = this;
- return {
- number: '',
- uid: '', //转入用户UID
- userinfo: {},
-
- isWeixin: this.$wechat.isWeixin(),
-
- };
- },
- computed: mapGetters(['isLogin']),
- watch: {
- isLogin: {
- handler: function(newV, oldV) {
- if (newV) {
- this.getUserInfo();
- }
- },
- deep: true
- }
- },
- onLoad(options) {
- if (this.isLogin) {
- this.getUserInfo();
- } else {
- toLogin();
- }
- },
- onShow() {},
- methods: {
- onLunch() {
- this.getUserInfo();
- },
- inputNum: function(e) {
- let val = e.detail.value;
- let dot = val.indexOf('.');
- if (dot > -1) {
- this.moneyMaxLeng = dot + 3;
- } else {
- this.moneyMaxLeng = 8
- }
- },
- onLoadFun: function() {
- this.getUserInfo();
- },
-
- qr() {
- const that = this;
- uni.scanCode({
- success: function(res) {
- console.log('条码类型:' + res.scanType);
- console.log('条码内容:' + res.result);
- that.uid = res.result;
- }
- });
- },
-
-
- getUserInfo: function() {
- let that = this;
- getUserInfo().then(res => {
- that.$set(that, 'userinfo', res.data);
- })
- },
- submitSub: function(e) {
- let that = this
- let value = that.number;
- if (parseFloat(value) < 0 || parseFloat(value) == NaN || value == undefined || value == "") {
- return that.$util.Tips({
- title: '请输入数量'
- });
- }
-
- uni.showModal({
- title: '消费分转账',
- content: '佣金转出后无法撤回,确认是否转出消费分',
- success(res) {
- if (res.confirm) {
- integralTrade({
- to_uid: that.uid,
- num: parseFloat(value),
- }).then(res => {
- // that.$set(that, 'userinfo.now_money', that.$util.$h.Add(value, that.userinfo.now_money))
- return that.$util.Tips({
- title: '转入成功',
- icon: 'success'
- }, {
- tab: 5,
- url: '/pages/user/index'
- });
- }).catch(err => {
- return that.$util.Tips({
- title: err
- })
- });
- } else if (res.cancel) {
- return that.$util.Tips({
- title: '已取消'
- });
- }
- },
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- width: 100%;
- height: 100%;
- background-color: #fff;
- }
- .bgcolor {
- background-color: var(--view-theme)
- }
- .payment {
- position: relative;
- width: 100%;
- background-color: #fff;
- border-radius: 10rpx;
- padding-top: 25rpx;
- border-top-right-radius: 39rpx;
- border-top-left-radius: 39rpx;
- }
- .payment .nav {
- height: 75rpx;
- line-height: 75rpx;
- padding: 0 100rpx;
- }
- .payment .nav .item {
- font-size: 30rpx;
- color: #333;
- }
- .payment .nav .item.on {
- font-weight: bold;
- border-bottom: 4rpx solid var(--view-theme);
- }
- .payment .input {
- display: flex;
- align-items: center;
- justify-content: center;
- border-bottom: 1px dashed #dddddd;
- margin: 60rpx auto 0 auto;
- padding-bottom: 20rpx;
- font-size: 56rpx;
- color: #333333;
- flex-wrap: nowrap;
- }
- .payment .input text {
- padding-left: 106rpx;
- }
- .payment .input input {
- padding-right: 106rpx;
- width: 300rpx;
- height: 94rpx;
- text-align: center;
- font-size: 70rpx;
- }
- .payment .placeholder {
- color: #d0d0d0;
- height: 100%;
- line-height: 94rpx;
- }
- .payment .tip {
- font-size: 26rpx;
- color: #888888;
- padding: 0 30rpx;
- margin-top: 25rpx;
- }
- .payment .but {
- color: #fff;
- font-size: 30rpx;
- height: 100rpx;
- border-radius: 10rpx;
- margin: 46rpx 50rpx 0 50rpx;
- line-height: 100rpx;
- background-image: linear-gradient(45deg, #ffcdd3, #ffb0b3);
- }
- .payment-top {
- width: 100%;
- height: 350rpx;
- // background-color: var(--view-theme);
- background-image: linear-gradient(45deg, rgb(255, 242, 232) 10%, #fff0f2 35%, rgb(255, 234, 247) 45%, #ffcdd3 75%, #ffb0b3);
- .name {
- font-size: 26rpx;
- color: rgba(255, 255, 255, 0.8);
- margin-top: -38rpx;
- margin-bottom: 30rpx;
- }
- .pic {
- font-size: 32rpx;
- color: #fff;
- }
- .pic-font {
- font-size: 78rpx;
- color: #fff;
- }
- }
- .picList {
- margin: 30rpx 0;
- }
- .tips-box {
- .tips {
- font-size: 28rpx;
- color: #333333;
- font-weight: 800;
- margin-bottom: 14rpx;
- margin-top: 20rpx;
- }
- .tips-samll {
- font-size: 24rpx;
- color: #333333;
- margin-bottom: 14rpx;
- }
- .tip-box {
- margin-top: 30rpx;
- }
- }
- .tips-title {
- padding-left: 30rpx;
- margin-top: 20rpx;
- font-size: 24rpx;
- color: #333;
- }
- .to_uid {
- padding: 20rpx;
- width: 100%;
- line-height: 1;
- font-size: 28rpx;
- align-items: center;
- border-bottom: 1px solid #dddddd;
- .title {
- font-weight: bold;
- }
- .uidbox {
- flex-grow: 1;
- text-align: right;
- }
- .placeholderUid {
- text-align: right;
- }
- }
- .tipimg {
- width: 50rpx;
- height: 50rpx;
- margin-left: 10rpx;
- }
- </style>
|