作者 Rico

write page

@@ -5,6 +5,84 @@ import Wechat from './common/wechat/wechat'; @@ -5,6 +5,84 @@ import Wechat from './common/wechat/wechat';
5 import store from '@/common/store'; 5 import store from '@/common/store';
6 6
7 export default { 7 export default {
  8 +
  9 + post:function(url, data, method, codetype) {
  10 + // console.log(url)
  11 + let t = this;
  12 + var promise = new Promise((resolve, reject) => {
  13 + //init
  14 + let header = {
  15 + 'content-Type': 'application/x-www-form-urlencoded',
  16 + // 记得改token
  17 + // be151a07-a60f-436c-a63a-fb7fea42e2c8
  18 + // uni.getStorageSync('token') || ''
  19 + token: 'be151a07-a60f-436c-a63a-fb7fea42e2c8'
  20 + };
  21 + // console.log(header)
  22 + // let method = '';
  23 + // console.log(url + url)
  24 + // console.log(token)
  25 + // uni.showLoading({
  26 + // title: '加载中',
  27 + // })
  28 + //网络请求
  29 + // console.log(data)
  30 + uni.getNetworkType({
  31 + success(r) {
  32 + if (r.networkType == 'none') {
  33 + uni.showToast({
  34 + title: '您还没有连接网络哦,请先连接网络吧~',
  35 + icon: 'none',
  36 + duration: 1300
  37 + });
  38 + } else {
  39 + uni.request({
  40 + url: t.globalData.baseUrl + url,
  41 + data: data,
  42 + method: method || 'POST',
  43 + header: header,
  44 + emulateJSON: true,
  45 + success: function(res) {
  46 + //返回取得的数据
  47 + // uni.hideLoading();
  48 + if (res.data.code == 1) {
  49 + resolve(res.data);
  50 + } else if (res.data.code == 401) {
  51 + uni.removeStorageSync('token');
  52 + } else {
  53 + resolve(res.data);
  54 + }
  55 + },
  56 + fail: function(e) {
  57 + // console.log('88888888888888888')
  58 + // uni.hideLoading();
  59 + reject('网络出错');
  60 + uni.hideNavigationBarLoading();
  61 + uni.showToast({
  62 + title: '网络要挤爆啦,请稍后重试吧~',
  63 + icon: 'none',
  64 + duration: 1300
  65 + });
  66 + },
  67 + complete: function(daa) {
  68 + // console.log(daa);
  69 + // console.log('99999999999999999999999999999999999')
  70 + }
  71 + });
  72 + }
  73 + }
  74 + });
  75 + });
  76 + return promise;
  77 + },
  78 +
  79 + globalData: {
  80 + userInfo: null,
  81 + // baseUrl: 'http://sortmessage.t.brotop.cn/api/',
  82 + baseUrl: 'http://suquan.t.brotop.cn/',
  83 + switch:true,
  84 + // imgUrl: 'https://yuanli.qingdi.com.cn/'
  85 + },
8 methods: { 86 methods: {
9 //应用初始化,获取模板,获取页面路由,获取用户信息,保存用户Token并返回初始进入页面 87 //应用初始化,获取模板,获取页面路由,获取用户信息,保存用户Token并返回初始进入页面
10 ...mapActions(['getAppInit', 'getTemplate', 'getRoutes', 'getUserInfo', 'setTokenAndBack']), 88 ...mapActions(['getAppInit', 'getTemplate', 'getRoutes', 'getUserInfo', 'setTokenAndBack']),
@@ -10,8 +10,8 @@ let protocol = window.location.protocol; @@ -10,8 +10,8 @@ let protocol = window.location.protocol;
10 // #endif 10 // #endif
11 11
12 const ENV_BASE_URL = { 12 const ENV_BASE_URL = {
13 - development: 'https://api.7wpp.com', //开发环境  
14 - production: 'https://api.7wpp.com', //生产环境 13 + development: 'http://suquan.t.brotop.cn', //开发环境
  14 + production: 'http://suquan.t.brotop.cn', //生产环境
15 } 15 }
16 const ENV_API_URL = { 16 const ENV_API_URL = {
17 development: `${ENV_BASE_URL.development}/addons/shopro/`, //开发环境 17 development: `${ENV_BASE_URL.development}/addons/shopro/`, //开发环境
@@ -758,6 +758,24 @@ @@ -758,6 +758,24 @@
758 } 758 }
759 } 759 }
760 // 我的user ------ end 760 // 我的user ------ end
  761 + ,{
  762 + "path" : "lower-level/lower-level",
  763 + "style" :
  764 + {
  765 + "navigationBarTitleText": "我的小伙伴",
  766 + "enablePullDownRefresh": false
  767 + }
  768 +
  769 + }
  770 + ,{
  771 + "path" : "withdraw/withdraw",
  772 + "style" :
  773 + {
  774 + "navigationBarTitleText":"提现",
  775 + "enablePullDownRefresh": true
  776 + }
  777 +
  778 + }
761 ] 779 ]
762 } 780 }
763 ], 781 ],
@@ -64,6 +64,15 @@ export default { @@ -64,6 +64,15 @@ export default {
64 } 64 }
65 // 列表 65 // 列表
66 .menu-list-box { 66 .menu-list-box {
  67 + width: 686rpx;
  68 + margin: 0 auto;
  69 + box-shadow: 0px 8px 24px 0px rgba(9,101,138,0.15);
  70 + .menu-item:first-child{
  71 + border-radius: 16rpx 16rpx 0 0;
  72 + }
  73 + .menu-item:last-child{
  74 + border-radius: 0 0 16rpx 16rpx ;
  75 + }
67 .menu-item { 76 .menu-item {
68 height: 100rpx; 77 height: 100rpx;
69 padding: 0 30rpx; 78 padding: 0 30rpx;
1 <template> 1 <template>
2 <!-- 订单卡片 --> 2 <!-- 订单卡片 -->
3 - <view class="sh-order-box x-f mb10"> 3 + <view class="order-wrapper"> <!-- 为了加样式-->
  4 + <view class="sh-order-box x-f">
4 <view class="order-box x-f"> 5 <view class="order-box x-f">
5 <view class="order-item y-f" @tap="jump('/pages/order/list', { type: order.type })" v-for="order in orderNav" :key="order.id"> 6 <view class="order-item y-f" @tap="jump('/pages/order/list', { type: order.type })" v-for="order in orderNav" :key="order.id">
6 <view class="y-f item-box"> 7 <view class="y-f item-box">
@@ -9,24 +10,25 @@ @@ -9,24 +10,25 @@
9 <view class="cu-tag badge" v-if=" orderNum && orderNum[order.type]">{{ orderNum[order.type] }}</view> 10 <view class="cu-tag badge" v-if=" orderNum && orderNum[order.type]">{{ orderNum[order.type] }}</view>
10 </view> 11 </view>
11 </view> 12 </view>
12 - <view class="order-item y-f" @tap="jump('/pages/order/after-sale/list')"> 13 +<!-- <view class="order-item y-f" @tap="jump('/pages/order/after-sale/list')">
13 <view class="y-f item-box"> 14 <view class="y-f item-box">
14 <image class="order-img" src="http://shopro.7wpp.com/imgs/user/tab55.png" mode=""></image> 15 <image class="order-img" src="http://shopro.7wpp.com/imgs/user/tab55.png" mode=""></image>
15 <text class="item-title">退换货</text> 16 <text class="item-title">退换货</text>
16 - <!-- <view class="cu-tag badge"></view> -->  
17 - </view> 17 + <view class="cu-tag badge"></view>
18 </view> 18 </view>
  19 + </view> -->
19 </view> 20 </view>
20 21
21 <view class="order-item y-f all-order" @tap="jump('/pages/order/list', { type: 'all' })"> 22 <view class="order-item y-f all-order" @tap="jump('/pages/order/list', { type: 'all' })">
22 - <image class="cut-off--line" src="/static/imgs/user/cut_off_line.png" mode=""></image> 23 + <!-- <image class="cut-off--line" src="/static/imgs/user/cut_off_line.png" mode=""></image> -->
23 <view class="y-f item-box"> 24 <view class="y-f item-box">
24 <image class="order-img" src="/static/imgs/user/all_order.png" mode="aspectFill"></image> 25 <image class="order-img" src="/static/imgs/user/all_order.png" mode="aspectFill"></image>
25 - <text class="item-title">全部订单</text> 26 + <text class="item-title">全部</text>
26 <!-- <view class="cu-tag badge" v-if="orderNum[order.type]">{{ orderNum[order.type] }}</view> --> 27 <!-- <view class="cu-tag badge" v-if="orderNum[order.type]">{{ orderNum[order.type] }}</view> -->
27 </view> 28 </view>
28 </view> 29 </view>
29 </view> 30 </view>
  31 + </view>
30 </template> 32 </template>
31 33
32 <script> 34 <script>
@@ -42,12 +44,12 @@ export default { @@ -42,12 +44,12 @@ export default {
42 img: 'http://shopro.7wpp.com/imgs/user/tab11.png', 44 img: 'http://shopro.7wpp.com/imgs/user/tab11.png',
43 type: 'nopay' 45 type: 'nopay'
44 }, 46 },
45 - // {  
46 - // id: 2,  
47 - // title: '待发货',  
48 - // img: 'http://shopro.7wpp.com/imgs/user/tab22.png',  
49 - // type: 'nosend'  
50 - // }, 47 + {
  48 + id: 2,
  49 + title: '待发货',
  50 + img: 'http://shopro.7wpp.com/imgs/user/tab22.png',
  51 + type: 'nosend'
  52 + },
51 { 53 {
52 id: 3, 54 id: 3,
53 title: '待收货', 55 title: '待收货',
@@ -56,11 +58,17 @@ export default { @@ -56,11 +58,17 @@ export default {
56 }, 58 },
57 { 59 {
58 id: 4, 60 id: 4,
59 - title: '待评价', 61 + title: '已完成',
60 img: 'http://shopro.7wpp.com/imgs/user/tab44.png', 62 img: 'http://shopro.7wpp.com/imgs/user/tab44.png',
61 type: 'nocomment' 63 type: 'nocomment'
62 }, 64 },
63 // { 65 // {
  66 + // id: 4,
  67 + // title: '待评价',
  68 + // img: 'http://shopro.7wpp.com/imgs/user/tab44.png',
  69 + // type: 'nocomment'
  70 + // },
  71 + // {
64 // id: 5, 72 // id: 5,
65 // title: '退换货', 73 // title: '退换货',
66 // img: 'http://shopro.7wpp.com/imgs/user/tab55.png', 74 // img: 'http://shopro.7wpp.com/imgs/user/tab55.png',
@@ -88,22 +96,29 @@ export default { @@ -88,22 +96,29 @@ export default {
88 96
89 <style lang="scss"> 97 <style lang="scss">
90 // 订单卡片 98 // 订单卡片
  99 +.order-wrapper{
  100 + padding-bottom: 32rpx !important;
  101 +}
91 .sh-order-box { 102 .sh-order-box {
92 - height: 180rpx; 103 + padding-top: 28rpx;
  104 + padding-bottom: 28rpx;
93 background: #fff; 105 background: #fff;
  106 + width: 686rpx;
  107 + border-radius: 16px;
  108 + margin: 0 auto;
94 .order-box { 109 .order-box {
95 flex: 4; 110 flex: 4;
96 } 111 }
97 .all-order { 112 .all-order {
98 position: relative; 113 position: relative;
99 - .cut-off--line {  
100 - position: absolute;  
101 - top: 50%;  
102 - transform: translateY(-50%);  
103 - right: (750rpx/5) - 15rpx;  
104 - width: 30rpx;  
105 - height: 136rpx;  
106 - } 114 + // .cut-off--line {
  115 + // position: absolute;
  116 + // top: 50%;
  117 + // transform: translateY(-50%);
  118 + // right: (750rpx/5) - 15rpx;
  119 + // width: 30rpx;
  120 + // height: 136rpx;
  121 + // }
107 } 122 }
108 .order-item { 123 .order-item {
109 flex: 1; 124 flex: 1;
1 <template> 1 <template>
2 <view> 2 <view>
3 - <view class="sh-userinfo-box" :style="{ backgroundColor: detail.color }">  
4 - <image class="user-bg" :src="detail.image" mode=""></image> 3 + <view class="sh-userinfo-box">
  4 + <!-- :style="{ backgroundColor: detail.color }" -->
  5 + <!-- <image class="user-bg" :src="detail.image" mode=""></image> -->
5 <view class="head-wrap"> 6 <view class="head-wrap">
6 <view class="titleNav pad"> 7 <view class="titleNav pad">
7 <view class="status-bar"></view> 8 <view class="status-bar"></view>
8 <text class="nav-title x-f"> 9 <text class="nav-title x-f">
9 - 我的 10 + <!-- 我的 -->
10 <!-- <text @tap="onService" class="cuIcon-servicefill"></text> --> 11 <!-- <text @tap="onService" class="cuIcon-servicefill"></text> -->
11 </text> 12 </text>
12 </view> 13 </view>
@@ -34,12 +35,17 @@ @@ -34,12 +35,17 @@
34 <text class="tag-title">{{ userInfo.group.name }}</text> 35 <text class="tag-title">{{ userInfo.group.name }}</text>
35 </view> 36 </view>
36 </view> 37 </view>
37 - <view class="x-f"> 38 +<!-- <view class="x-f">
38 <button class="cu-btn code-btn" v-if="userInfo.avatar" @tap="jump('/pages/public/poster/index', { posterType: 'user' })"> 39 <button class="cu-btn code-btn" v-if="userInfo.avatar" @tap="jump('/pages/public/poster/index', { posterType: 'user' })">
39 <text class="cuIcon-qr_code"></text> 40 <text class="cuIcon-qr_code"></text>
40 </button> 41 </button>
41 <button v-if="userInfo.is_store" @tap="goStore" class="cu-btn merchant-btn">切换商家版</button> 42 <button v-if="userInfo.is_store" @tap="goStore" class="cu-btn merchant-btn">切换商家版</button>
42 - </view> 43 + </view> -->
  44 +
  45 +
  46 + <!-- 等待添加按钮 -->
  47 + <image class="feedback" src="../../../static/feedback.png"></image>
  48 + <!-- -->
43 </view> 49 </view>
44 </view> 50 </view>
45 </view> 51 </view>
@@ -126,6 +132,11 @@ export default { @@ -126,6 +132,11 @@ export default {
126 </script> 132 </script>
127 133
128 <style lang="scss"> 134 <style lang="scss">
  135 + .feedback{
  136 + width: 48rpx;
  137 + height: 48rpx;
  138 + margin-right: 30rpx;
  139 + }
129 .sh-userinfo-box { 140 .sh-userinfo-box {
130 position: relative; 141 position: relative;
131 height: 320rpx; 142 height: 320rpx;
@@ -169,6 +180,7 @@ export default { @@ -169,6 +180,7 @@ export default {
169 180
170 .user-head { 181 .user-head {
171 padding-top: 50rpx; 182 padding-top: 50rpx;
  183 + align-items: flex-start;
172 .info-box { 184 .info-box {
173 padding-left: 30rpx; 185 padding-left: 30rpx;
174 .head-img-wrap { 186 .head-img-wrap {
@@ -18,16 +18,30 @@ @@ -18,16 +18,30 @@
18 <sh-seckill v-if="item.type === 'seckill'" :detail="item.content"></sh-seckill> 18 <sh-seckill v-if="item.type === 'seckill'" :detail="item.content"></sh-seckill>
19 <!-- 拼团 --> 19 <!-- 拼团 -->
20 <sh-groupon v-if="item.type === 'groupon'" :detail="item.content"></sh-groupon> 20 <sh-groupon v-if="item.type === 'groupon'" :detail="item.content"></sh-groupon>
  21 +
  22 +
  23 + <!-- DIY -->
  24 + <!-- 发现bug则归位 -->
  25 + <!-- item.type === 'user' || item.type === 'order-card' || -->
  26 + <view v-if=" item.type === 'nav-list'" class="back-wrapper">
21 <!-- 个人信息 --> 27 <!-- 个人信息 -->
22 - <sh-userinfo v-if="item.type === 'user'" :detail="item.content"></sh-userinfo> 28 + <!-- -->
  29 + <!-- v-if="item.type === 'user'" -->
  30 + <sh-userinfo :detail="item.content"></sh-userinfo>
23 <!-- 订单卡片 --> 31 <!-- 订单卡片 -->
24 - <sh-order v-if="item.type === 'order-card'" :detail="item.content"></sh-order> 32 + <!-- -->
  33 + <!-- v-if="item.type === 'order-card'" -->
  34 + <sh-order :detail="item.content"></sh-order>
25 <!-- 功能列表 --> 35 <!-- 功能列表 -->
26 - <sh-nav v-if="item.type === 'nav-list'" :detail="item.content"></sh-nav> 36 + <!-- -->
  37 + <!-- v-if="item.type === 'nav-list'" -->
  38 + <sh-nav :detail="item.content"></sh-nav>
  39 + </view>
  40 +
27 <!-- 钱包 --> 41 <!-- 钱包 -->
28 - <sh-wallet v-if="item.type === 'wallet-card'" :detail="item.content"></sh-wallet> 42 + <!-- 溯泉不需要 <sh-wallet v-if="item.type === 'wallet-card'" :detail="item.content"></sh-wallet> -->
29 <!-- 九宫格列表 --> 43 <!-- 九宫格列表 -->
30 - <sh-grid v-if="item.type === 'grid-list'" :detail="item.content"></sh-grid> 44 + <!-- <sh-grid v-if="item.type === 'grid-list'" :detail="item.content"></sh-grid> -->
31 <!-- 富文本 --> 45 <!-- 富文本 -->
32 <sh-richtext v-if="item.type === 'rich-text'" :detail="item.content"></sh-richtext> 46 <sh-richtext v-if="item.type === 'rich-text'" :detail="item.content"></sh-richtext>
33 <!-- 功能标题 --> 47 <!-- 功能标题 -->
@@ -59,7 +73,6 @@ @@ -59,7 +73,6 @@
59 73
60 <script> 74 <script>
61 import Wechat from '@/common/wechat/wechat'; 75 import Wechat from '@/common/wechat/wechat';
62 -  
63 import shSearch from './components/sh-search.vue'; 76 import shSearch from './components/sh-search.vue';
64 import shBanner from './components/sh-banner.vue'; 77 import shBanner from './components/sh-banner.vue';
65 import shHotGoods from './components/sh-hot-goods.vue'; 78 import shHotGoods from './components/sh-hot-goods.vue';
@@ -160,6 +173,11 @@ export default { @@ -160,6 +173,11 @@ export default {
160 </script> 173 </script>
161 174
162 <style lang="scss"> 175 <style lang="scss">
  176 +.back-wrapper{
  177 + background-size: cover;
  178 + background-image:url('../../static/background.png');
  179 + background-repeat: no-repeat;
  180 +}
163 .user-box { 181 .user-box {
164 overflow-x: hidden; 182 overflow-x: hidden;
165 position: relative; 183 position: relative;
  1 +<template>
  2 + <view>
  3 + <!-- title -->
  4 + <view class="lower-title">
  5 + <view class="lower-top">
  6 + <view>
  7 + <view>{{comm}}</view>
  8 + <view>可提现奖励</view>
  9 + </view>
  10 + <view @click="toTi">提现</view>
  11 + </view>
  12 +
  13 + <view class="lower-bottom">
  14 + <!-- 占位 -->
  15 + <view></view>
  16 + <view>
  17 + <view>{{comm_sum}}</view>
  18 + <view>累计获得奖励</view>
  19 + </view>
  20 + <view>
  21 + <view>{{comm_month}}</view>
  22 + <view>本月获得奖励</view>
  23 + </view>
  24 + </view>
  25 +
  26 + </view>
  27 +
  28 +
  29 + <view class="nav-wrp">
  30 + <view class="nav-list">
  31 + <view>
  32 + <image src="../../../static/up.png" mode=""></image>
  33 + <view>当前奖励比例</view>
  34 + </view>
  35 + <image src="../../../static/back.png" mode=""></image>
  36 + </view>
  37 +
  38 + <view class="nav-list">
  39 + <view>
  40 + <image src="../../../static/all.png" mode=""></image>
  41 + <view>我的事业</view>
  42 + </view>
  43 + <image src="../../../static/back.png" mode=""></image>
  44 + </view>
  45 +
  46 + <view class="nav-list">
  47 + <view>
  48 + <image src="../../../static/mssion.png" mode=""></image>
  49 + <view>奖励清单</view>
  50 + </view>
  51 + <image src="../../../static/back.png" mode=""></image>
  52 + </view>
  53 +
  54 + <view class="nav-list">
  55 + <view>
  56 + <image src="../../../static/friend.png" mode=""></image>
  57 + <view>我的伙伴</view>
  58 + </view>
  59 + <image src="../../../static/back.png" mode=""></image>
  60 + </view>
  61 +
  62 + <view class="nav-list">
  63 + <view>
  64 + <image src="../../../static/group.png" mode=""></image>
  65 + <view>我的二维码</view>
  66 + </view>
  67 + <image src="../../../static/back.png" mode=""></image>
  68 + </view>
  69 +
  70 +
  71 +
  72 + </view>
  73 +
  74 +
  75 +
  76 + </view>
  77 +</template>
  78 +
  79 +<script>
  80 + import request from "../../../App.vue"
  81 + export default {
  82 + data() {
  83 + return {
  84 + // 可提现 累计 今日
  85 + comm:'',
  86 + comm_sum:'',
  87 + comm_month:'',
  88 + };
  89 + },
  90 + methods:{
  91 + toTi(){
  92 + uni.navigateTo({
  93 + url:'/pages/user/withdraw/withdraw'
  94 + })
  95 + }
  96 + },
  97 + onLoad:function(){
  98 + request.post('/api/user/commission').then(r=>{
  99 + if(r.code == 1){
  100 + this.comm = r.data.commission
  101 + this.comm_sum = r.data.commission_month
  102 + this.comm_month = r.data.commission_sum
  103 + }
  104 + })
  105 + }
  106 + }
  107 +</script>
  108 +
  109 +<style lang="scss" scoped>
  110 + *{
  111 + margin: 0;
  112 + padding: 0;
  113 + box-sizing: border-box;
  114 + }
  115 +
  116 + .lower-title{
  117 + box-shadow: 4px 3px 6px 0px #ff5722a6;
  118 + width: 686rpx;
  119 + background-size: cover;
  120 + margin: 0 auto;
  121 + margin-top: 32rpx;
  122 + border-radius: 16rpx;
  123 + background-image: url('../../../static/lower-level.png');
  124 + padding:48rpx 32rpx 32rpx 32rpx;
  125 + .lower-top{
  126 + display: flex;
  127 + align-items: flex-start;
  128 + justify-content: space-between;
  129 + >view:first-child{
  130 + color: white;
  131 + >view:first-child{
  132 + font-size: 56rpx;
  133 + font-weight: 600;
  134 + padding-bottom: 8rpx;
  135 + }
  136 + >view:last-child{
  137 + font-size: 28rpx;
  138 + font-weight: 400;
  139 + }
  140 + }
  141 + >view:last-child{
  142 + border: 5rpx solid #FFFFFF;
  143 + color: white;
  144 + font-size: 24rpx;
  145 + font-weight: 400;
  146 + padding: 16rpx 32rpx;
  147 + border-radius: 32rpx;
  148 + }
  149 + }
  150 + }
  151 +
  152 + .lower-bottom{
  153 + display: flex;
  154 + justify-content: space-around;
  155 + color: white;
  156 + padding-top: 54rpx;
  157 + >view:nth-child(2){
  158 + >view:first-child{
  159 + font-size: 36rpx;
  160 + font-weight: 600;
  161 + }
  162 + >view:last-child{
  163 + font-size: 24rpx;
  164 + }
  165 + }
  166 + >view:nth-child(3){
  167 + >view:first-child{
  168 + font-size: 36rpx;
  169 + font-weight: 600;
  170 + }
  171 + >view:last-child{
  172 + font-size: 24rpx;
  173 + }
  174 + }
  175 + }
  176 +
  177 + .nav-wrp{
  178 + width: 686rpx;
  179 + margin: 0 auto;
  180 + padding-top: 100rpx;
  181 + >.nav-list{
  182 + display: flex;
  183 + align-items: center;
  184 + justify-content: space-between;
  185 + border-bottom: 1rpx solid rgba(25, 24, 51, 0.10);
  186 + padding-bottom: 30rpx;
  187 + padding-top: 29rpx;
  188 + >view{
  189 + display: flex;
  190 + align-items: center;
  191 + >image{
  192 + width: 48rpx;
  193 + height: 48rpx;
  194 + }
  195 + >view{
  196 + color: #191833;
  197 + font-size: 28rpx;
  198 + font-weight: 400;
  199 + margin-left: 16rpx;
  200 + }
  201 + }
  202 + >image{
  203 + width: 32rpx;
  204 + height: 32rpx;
  205 + }
  206 + }
  207 + }
  208 +
  209 +</style>
  1 +<template>
  2 + <view class="withdraw">
  3 + <view>提现金额</view>
  4 + <view>
  5 + <input class="plaa" v-model="money" :value="money" placeholder-class="pla" type="text" placeholder="请输入提现金额" />
  6 + </view>
  7 + <view class="withdraw-tips">
  8 + <view>可提现金额{{comm}}</view>
  9 + <view @click="all_">全部提现</view>
  10 + </view>
  11 +
  12 + <view class="withdraw-w" @click="withdraw_">提现</view>
  13 + </view>
  14 +</template>
  15 +
  16 +<script>
  17 + import request from "../../../App.vue"
  18 + export default {
  19 + onPullDownRefresh(){
  20 + request.post('/api/user/commission').then(r=>{
  21 + if(r.code == 1){
  22 + this.comm = r.data.commission
  23 + this.money = ''
  24 + uni.stopPullDownRefresh();
  25 + }
  26 + })
  27 + },
  28 + data() {
  29 + return {
  30 + comm:0,
  31 + money:''
  32 + };
  33 + },
  34 + onLoad:function(){
  35 + request.post('/api/user/commission').then(r=>{
  36 + if(r.code == 1){
  37 + this.comm = r.data.commission
  38 + }
  39 + })
  40 + },
  41 + methods:{
  42 + all_(){
  43 + this.money = this.comm
  44 + },
  45 + withdraw_(){
  46 + const data = {
  47 + money:this.money
  48 + }
  49 + request.post('api/user_commission_apply/apply',data).then(r=>{
  50 + if(r.code == 1){
  51 + uni.showToast({
  52 + title:r.msg,
  53 + icon:'none',
  54 + success(){
  55 + uni.startPullDownRefresh({
  56 + })
  57 + }
  58 + })
  59 + }else if(r.code == 0){
  60 + uni.showToast({
  61 + title:r.msg,
  62 + icon:'none',
  63 + success(){
  64 + uni.startPullDownRefresh()
  65 + }
  66 + })
  67 + }
  68 + })
  69 + }
  70 + }
  71 + }
  72 +</script>
  73 +
  74 +<style lang="scss" scoped>
  75 + *{
  76 + margin: 0;
  77 + padding: 0;
  78 + box-sizing: border-box;
  79 + }
  80 + page{
  81 + background-color: white;
  82 + }
  83 + .withdraw{
  84 + width: 686rpx;
  85 + margin: 0 auto;
  86 + >view:first-child{
  87 + color: #22272b;
  88 + font-size: 28rpx;
  89 + font-weight: 400;
  90 + }
  91 + >view:nth-child(2){
  92 + padding-top: 36rpx;
  93 + padding-bottom: 24rpx;
  94 + border-bottom: 1rpx solid #F2F3F5;
  95 + margin-bottom: 27rpx;
  96 + display: flex;
  97 + align-items: flex-end;
  98 + .pla{
  99 + font-size: 48rpx;
  100 + color: #646566;
  101 + }
  102 + .plaa{
  103 + font-size: 48rpx;
  104 +
  105 + }
  106 + &::before{
  107 + content:'¥';
  108 + font-size: 28rpx;
  109 + font-weight: 400;
  110 + }
  111 + }
  112 + }
  113 +
  114 + .withdraw-tips{
  115 + display: flex;
  116 + margin-bottom: 24rpx;
  117 + >view:first-child{
  118 + color: #646566;
  119 + font-size: 24rpx;
  120 + }
  121 + >view:last-child{
  122 + margin-left: 16rpx;
  123 + color: #2D51AF;
  124 + font-size: 24rpx;
  125 + }
  126 + }
  127 +
  128 + .withdraw-w{
  129 + display: flex;
  130 + background: linear-gradient(135deg,#f95633, #fc8c06);
  131 + border-radius: 16rpx;
  132 + font-size: 30rpx;
  133 + color: white;
  134 + justify-content: center;
  135 + padding-top: 24rpx;
  136 + padding-bottom: 24rpx;
  137 + margin-top: 112rpx;
  138 + // padding: 24rpx 314rpx;
  139 + }
  140 +</style>

600 字节

711 字节