作者 Rico

write page

... ... @@ -5,6 +5,84 @@ import Wechat from './common/wechat/wechat';
import store from '@/common/store';
export default {
post:function(url, data, method, codetype) {
// console.log(url)
let t = this;
var promise = new Promise((resolve, reject) => {
//init
let header = {
'content-Type': 'application/x-www-form-urlencoded',
// 记得改token
// be151a07-a60f-436c-a63a-fb7fea42e2c8
// uni.getStorageSync('token') || ''
token: 'be151a07-a60f-436c-a63a-fb7fea42e2c8'
};
// console.log(header)
// let method = '';
// console.log(url + url)
// console.log(token)
// uni.showLoading({
// title: '加载中',
// })
//网络请求
// console.log(data)
uni.getNetworkType({
success(r) {
if (r.networkType == 'none') {
uni.showToast({
title: '您还没有连接网络哦,请先连接网络吧~',
icon: 'none',
duration: 1300
});
} else {
uni.request({
url: t.globalData.baseUrl + url,
data: data,
method: method || 'POST',
header: header,
emulateJSON: true,
success: function(res) {
//返回取得的数据
// uni.hideLoading();
if (res.data.code == 1) {
resolve(res.data);
} else if (res.data.code == 401) {
uni.removeStorageSync('token');
} else {
resolve(res.data);
}
},
fail: function(e) {
// console.log('88888888888888888')
// uni.hideLoading();
reject('网络出错');
uni.hideNavigationBarLoading();
uni.showToast({
title: '网络要挤爆啦,请稍后重试吧~',
icon: 'none',
duration: 1300
});
},
complete: function(daa) {
// console.log(daa);
// console.log('99999999999999999999999999999999999')
}
});
}
}
});
});
return promise;
},
globalData: {
userInfo: null,
// baseUrl: 'http://sortmessage.t.brotop.cn/api/',
baseUrl: 'http://suquan.t.brotop.cn/',
switch:true,
// imgUrl: 'https://yuanli.qingdi.com.cn/'
},
methods: {
//应用初始化,获取模板,获取页面路由,获取用户信息,保存用户Token并返回初始进入页面
...mapActions(['getAppInit', 'getTemplate', 'getRoutes', 'getUserInfo', 'setTokenAndBack']),
... ...
... ... @@ -10,8 +10,8 @@ let protocol = window.location.protocol;
// #endif
const ENV_BASE_URL = {
development: 'https://api.7wpp.com', //开发环境
production: 'https://api.7wpp.com', //生产环境
development: 'http://suquan.t.brotop.cn', //开发环境
production: 'http://suquan.t.brotop.cn', //生产环境
}
const ENV_API_URL = {
development: `${ENV_BASE_URL.development}/addons/shopro/`, //开发环境
... ...
... ... @@ -758,6 +758,24 @@
}
}
// 我的user ------ end
,{
"path" : "lower-level/lower-level",
"style" :
{
"navigationBarTitleText": "我的小伙伴",
"enablePullDownRefresh": false
}
}
,{
"path" : "withdraw/withdraw",
"style" :
{
"navigationBarTitleText":"提现",
"enablePullDownRefresh": true
}
}
]
}
],
... ...
... ... @@ -64,6 +64,15 @@ export default {
}
// 列表
.menu-list-box {
width: 686rpx;
margin: 0 auto;
box-shadow: 0px 8px 24px 0px rgba(9,101,138,0.15);
.menu-item:first-child{
border-radius: 16rpx 16rpx 0 0;
}
.menu-item:last-child{
border-radius: 0 0 16rpx 16rpx ;
}
.menu-item {
height: 100rpx;
padding: 0 30rpx;
... ...
<template>
<!-- 订单卡片 -->
<view class="sh-order-box x-f mb10">
<view class="order-wrapper"> <!-- 为了加样式-->
<view class="sh-order-box x-f">
<view class="order-box x-f">
<view class="order-item y-f" @tap="jump('/pages/order/list', { type: order.type })" v-for="order in orderNav" :key="order.id">
<view class="y-f item-box">
... ... @@ -9,24 +10,25 @@
<view class="cu-tag badge" v-if=" orderNum && orderNum[order.type]">{{ orderNum[order.type] }}</view>
</view>
</view>
<view class="order-item y-f" @tap="jump('/pages/order/after-sale/list')">
<!-- <view class="order-item y-f" @tap="jump('/pages/order/after-sale/list')">
<view class="y-f item-box">
<image class="order-img" src="http://shopro.7wpp.com/imgs/user/tab55.png" mode=""></image>
<text class="item-title">退换货</text>
<!-- <view class="cu-tag badge"></view> -->
</view>
<view class="cu-tag badge"></view>
</view>
</view> -->
</view>
<view class="order-item y-f all-order" @tap="jump('/pages/order/list', { type: 'all' })">
<image class="cut-off--line" src="/static/imgs/user/cut_off_line.png" mode=""></image>
<!-- <image class="cut-off--line" src="/static/imgs/user/cut_off_line.png" mode=""></image> -->
<view class="y-f item-box">
<image class="order-img" src="/static/imgs/user/all_order.png" mode="aspectFill"></image>
<text class="item-title">全部订单</text>
<text class="item-title">全部</text>
<!-- <view class="cu-tag badge" v-if="orderNum[order.type]">{{ orderNum[order.type] }}</view> -->
</view>
</view>
</view>
</view>
</template>
<script>
... ... @@ -42,12 +44,12 @@ export default {
img: 'http://shopro.7wpp.com/imgs/user/tab11.png',
type: 'nopay'
},
// {
// id: 2,
// title: '待发货',
// img: 'http://shopro.7wpp.com/imgs/user/tab22.png',
// type: 'nosend'
// },
{
id: 2,
title: '待发货',
img: 'http://shopro.7wpp.com/imgs/user/tab22.png',
type: 'nosend'
},
{
id: 3,
title: '待收货',
... ... @@ -56,11 +58,17 @@ export default {
},
{
id: 4,
title: '待评价',
title: '已完成',
img: 'http://shopro.7wpp.com/imgs/user/tab44.png',
type: 'nocomment'
},
// {
// id: 4,
// title: '待评价',
// img: 'http://shopro.7wpp.com/imgs/user/tab44.png',
// type: 'nocomment'
// },
// {
// id: 5,
// title: '退换货',
// img: 'http://shopro.7wpp.com/imgs/user/tab55.png',
... ... @@ -88,22 +96,29 @@ export default {
<style lang="scss">
// 订单卡片
.order-wrapper{
padding-bottom: 32rpx !important;
}
.sh-order-box {
height: 180rpx;
padding-top: 28rpx;
padding-bottom: 28rpx;
background: #fff;
width: 686rpx;
border-radius: 16px;
margin: 0 auto;
.order-box {
flex: 4;
}
.all-order {
position: relative;
.cut-off--line {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: (750rpx/5) - 15rpx;
width: 30rpx;
height: 136rpx;
}
// .cut-off--line {
// position: absolute;
// top: 50%;
// transform: translateY(-50%);
// right: (750rpx/5) - 15rpx;
// width: 30rpx;
// height: 136rpx;
// }
}
.order-item {
flex: 1;
... ...
<template>
<view>
<view class="sh-userinfo-box" :style="{ backgroundColor: detail.color }">
<image class="user-bg" :src="detail.image" mode=""></image>
<view class="sh-userinfo-box">
<!-- :style="{ backgroundColor: detail.color }" -->
<!-- <image class="user-bg" :src="detail.image" mode=""></image> -->
<view class="head-wrap">
<view class="titleNav pad">
<view class="status-bar"></view>
<text class="nav-title x-f">
我的
<!-- 我的 -->
<!-- <text @tap="onService" class="cuIcon-servicefill"></text> -->
</text>
</view>
... ... @@ -34,12 +35,17 @@
<text class="tag-title">{{ userInfo.group.name }}</text>
</view>
</view>
<view class="x-f">
<!-- <view class="x-f">
<button class="cu-btn code-btn" v-if="userInfo.avatar" @tap="jump('/pages/public/poster/index', { posterType: 'user' })">
<text class="cuIcon-qr_code"></text>
</button>
<button v-if="userInfo.is_store" @tap="goStore" class="cu-btn merchant-btn">切换商家版</button>
</view>
</view> -->
<!-- 等待添加按钮 -->
<image class="feedback" src="../../../static/feedback.png"></image>
<!-- -->
</view>
</view>
</view>
... ... @@ -126,6 +132,11 @@ export default {
</script>
<style lang="scss">
.feedback{
width: 48rpx;
height: 48rpx;
margin-right: 30rpx;
}
.sh-userinfo-box {
position: relative;
height: 320rpx;
... ... @@ -169,6 +180,7 @@ export default {
.user-head {
padding-top: 50rpx;
align-items: flex-start;
.info-box {
padding-left: 30rpx;
.head-img-wrap {
... ...
... ... @@ -18,16 +18,30 @@
<sh-seckill v-if="item.type === 'seckill'" :detail="item.content"></sh-seckill>
<!-- 拼团 -->
<sh-groupon v-if="item.type === 'groupon'" :detail="item.content"></sh-groupon>
<!-- DIY -->
<!-- 发现bug则归位 -->
<!-- item.type === 'user' || item.type === 'order-card' || -->
<view v-if=" item.type === 'nav-list'" class="back-wrapper">
<!-- 个人信息 -->
<sh-userinfo v-if="item.type === 'user'" :detail="item.content"></sh-userinfo>
<!-- -->
<!-- v-if="item.type === 'user'" -->
<sh-userinfo :detail="item.content"></sh-userinfo>
<!-- 订单卡片 -->
<sh-order v-if="item.type === 'order-card'" :detail="item.content"></sh-order>
<!-- -->
<!-- v-if="item.type === 'order-card'" -->
<sh-order :detail="item.content"></sh-order>
<!-- 功能列表 -->
<sh-nav v-if="item.type === 'nav-list'" :detail="item.content"></sh-nav>
<!-- -->
<!-- v-if="item.type === 'nav-list'" -->
<sh-nav :detail="item.content"></sh-nav>
</view>
<!-- 钱包 -->
<sh-wallet v-if="item.type === 'wallet-card'" :detail="item.content"></sh-wallet>
<!-- 溯泉不需要 <sh-wallet v-if="item.type === 'wallet-card'" :detail="item.content"></sh-wallet> -->
<!-- 九宫格列表 -->
<sh-grid v-if="item.type === 'grid-list'" :detail="item.content"></sh-grid>
<!-- <sh-grid v-if="item.type === 'grid-list'" :detail="item.content"></sh-grid> -->
<!-- 富文本 -->
<sh-richtext v-if="item.type === 'rich-text'" :detail="item.content"></sh-richtext>
<!-- 功能标题 -->
... ... @@ -59,7 +73,6 @@
<script>
import Wechat from '@/common/wechat/wechat';
import shSearch from './components/sh-search.vue';
import shBanner from './components/sh-banner.vue';
import shHotGoods from './components/sh-hot-goods.vue';
... ... @@ -160,6 +173,11 @@ export default {
</script>
<style lang="scss">
.back-wrapper{
background-size: cover;
background-image:url('../../static/background.png');
background-repeat: no-repeat;
}
.user-box {
overflow-x: hidden;
position: relative;
... ...
<template>
<view>
<!-- title -->
<view class="lower-title">
<view class="lower-top">
<view>
<view>{{comm}}</view>
<view>可提现奖励</view>
</view>
<view @click="toTi">提现</view>
</view>
<view class="lower-bottom">
<!-- 占位 -->
<view></view>
<view>
<view>{{comm_sum}}</view>
<view>累计获得奖励</view>
</view>
<view>
<view>{{comm_month}}</view>
<view>本月获得奖励</view>
</view>
</view>
</view>
<view class="nav-wrp">
<view class="nav-list">
<view>
<image src="../../../static/up.png" mode=""></image>
<view>当前奖励比例</view>
</view>
<image src="../../../static/back.png" mode=""></image>
</view>
<view class="nav-list">
<view>
<image src="../../../static/all.png" mode=""></image>
<view>我的事业</view>
</view>
<image src="../../../static/back.png" mode=""></image>
</view>
<view class="nav-list">
<view>
<image src="../../../static/mssion.png" mode=""></image>
<view>奖励清单</view>
</view>
<image src="../../../static/back.png" mode=""></image>
</view>
<view class="nav-list">
<view>
<image src="../../../static/friend.png" mode=""></image>
<view>我的伙伴</view>
</view>
<image src="../../../static/back.png" mode=""></image>
</view>
<view class="nav-list">
<view>
<image src="../../../static/group.png" mode=""></image>
<view>我的二维码</view>
</view>
<image src="../../../static/back.png" mode=""></image>
</view>
</view>
</view>
</template>
<script>
import request from "../../../App.vue"
export default {
data() {
return {
// 可提现 累计 今日
comm:'',
comm_sum:'',
comm_month:'',
};
},
methods:{
toTi(){
uni.navigateTo({
url:'/pages/user/withdraw/withdraw'
})
}
},
onLoad:function(){
request.post('/api/user/commission').then(r=>{
if(r.code == 1){
this.comm = r.data.commission
this.comm_sum = r.data.commission_month
this.comm_month = r.data.commission_sum
}
})
}
}
</script>
<style lang="scss" scoped>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.lower-title{
box-shadow: 4px 3px 6px 0px #ff5722a6;
width: 686rpx;
background-size: cover;
margin: 0 auto;
margin-top: 32rpx;
border-radius: 16rpx;
background-image: url('../../../static/lower-level.png');
padding:48rpx 32rpx 32rpx 32rpx;
.lower-top{
display: flex;
align-items: flex-start;
justify-content: space-between;
>view:first-child{
color: white;
>view:first-child{
font-size: 56rpx;
font-weight: 600;
padding-bottom: 8rpx;
}
>view:last-child{
font-size: 28rpx;
font-weight: 400;
}
}
>view:last-child{
border: 5rpx solid #FFFFFF;
color: white;
font-size: 24rpx;
font-weight: 400;
padding: 16rpx 32rpx;
border-radius: 32rpx;
}
}
}
.lower-bottom{
display: flex;
justify-content: space-around;
color: white;
padding-top: 54rpx;
>view:nth-child(2){
>view:first-child{
font-size: 36rpx;
font-weight: 600;
}
>view:last-child{
font-size: 24rpx;
}
}
>view:nth-child(3){
>view:first-child{
font-size: 36rpx;
font-weight: 600;
}
>view:last-child{
font-size: 24rpx;
}
}
}
.nav-wrp{
width: 686rpx;
margin: 0 auto;
padding-top: 100rpx;
>.nav-list{
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid rgba(25, 24, 51, 0.10);
padding-bottom: 30rpx;
padding-top: 29rpx;
>view{
display: flex;
align-items: center;
>image{
width: 48rpx;
height: 48rpx;
}
>view{
color: #191833;
font-size: 28rpx;
font-weight: 400;
margin-left: 16rpx;
}
}
>image{
width: 32rpx;
height: 32rpx;
}
}
}
</style>
... ...
<template>
<view class="withdraw">
<view>提现金额</view>
<view>
<input class="plaa" v-model="money" :value="money" placeholder-class="pla" type="text" placeholder="请输入提现金额" />
</view>
<view class="withdraw-tips">
<view>可提现金额{{comm}}</view>
<view @click="all_">全部提现</view>
</view>
<view class="withdraw-w" @click="withdraw_">提现</view>
</view>
</template>
<script>
import request from "../../../App.vue"
export default {
onPullDownRefresh(){
request.post('/api/user/commission').then(r=>{
if(r.code == 1){
this.comm = r.data.commission
this.money = ''
uni.stopPullDownRefresh();
}
})
},
data() {
return {
comm:0,
money:''
};
},
onLoad:function(){
request.post('/api/user/commission').then(r=>{
if(r.code == 1){
this.comm = r.data.commission
}
})
},
methods:{
all_(){
this.money = this.comm
},
withdraw_(){
const data = {
money:this.money
}
request.post('api/user_commission_apply/apply',data).then(r=>{
if(r.code == 1){
uni.showToast({
title:r.msg,
icon:'none',
success(){
uni.startPullDownRefresh({
})
}
})
}else if(r.code == 0){
uni.showToast({
title:r.msg,
icon:'none',
success(){
uni.startPullDownRefresh()
}
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
page{
background-color: white;
}
.withdraw{
width: 686rpx;
margin: 0 auto;
>view:first-child{
color: #22272b;
font-size: 28rpx;
font-weight: 400;
}
>view:nth-child(2){
padding-top: 36rpx;
padding-bottom: 24rpx;
border-bottom: 1rpx solid #F2F3F5;
margin-bottom: 27rpx;
display: flex;
align-items: flex-end;
.pla{
font-size: 48rpx;
color: #646566;
}
.plaa{
font-size: 48rpx;
}
&::before{
content:'¥';
font-size: 28rpx;
font-weight: 400;
}
}
}
.withdraw-tips{
display: flex;
margin-bottom: 24rpx;
>view:first-child{
color: #646566;
font-size: 24rpx;
}
>view:last-child{
margin-left: 16rpx;
color: #2D51AF;
font-size: 24rpx;
}
}
.withdraw-w{
display: flex;
background: linear-gradient(135deg,#f95633, #fc8c06);
border-radius: 16rpx;
font-size: 30rpx;
color: white;
justify-content: center;
padding-top: 24rpx;
padding-bottom: 24rpx;
margin-top: 112rpx;
// padding: 24rpx 314rpx;
}
</style>
... ...

600 字节

711 字节