Browse Source

2023-8-29

cmy 2 years ago
parent
commit
4ec5679e98

+ 19 - 0
api/new.js

@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+// 转佣金
+export function setMoney(data) {
+	return request({
+		url: '/api/exchange',
+		method: 'post',
+		data
+	});
+}
+
+// 专用户
+export function setUserMoney(data) {
+	return request({
+		url: '/api/user/trade',
+		method: 'post',
+		data
+	});
+}

+ 3 - 3
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "宏根蒂",
+    "name" : "惠补",
     "appid" : "__UNI__D811809",
     "description" : "",
     "versionName" : "1.0.3",
@@ -104,7 +104,7 @@
         }
     },
     "h5" : {
-        "title" : "宏根蒂",
+        "title" : "惠补",
         "domain" : "",
         "router" : {
             "base" : "/index/",
@@ -113,7 +113,7 @@
         "devServer" : {
             "proxy" : {
                 "/api" : {
-                    "target" : "http://hgd.liuniu946.com/api",
+                    "target" : "http://hb.liuniukj.com/api",
                     // "changeOrigin": true,
                     "pathRewrite" : {
                         "/api" : "" // rewrite path

+ 6 - 0
pages.json

@@ -352,6 +352,12 @@
 				"navigationBarTitleText": "邀请好友"
 			}
 		},
+		{
+			"path": "pages/user/setintegral",
+			"style": {
+				"navigationBarTitleText": "积分转账"
+			}
+		},
 		{
 			"path": "pages/user/team",
 			"style": {

+ 13 - 13
pages/index/index.vue

@@ -3,7 +3,7 @@
 		<!-- <image src="" mode=""></image> -->
 		<!-- 顶部logo and 搜索 start-->
 		<view class="index-top-wrap">
-			<image src="../../static/index/index-top.png" mode="widthFix" class="index-top"></image>
+			<!-- <image src="../../static/index/index-top.png" mode="widthFix" class="index-top"></image> -->
 			<view class="status_bar fud"></view>
 			<view class="top-search flex fud">
 				<view class="search-box flex" @click="clickSearch()">
@@ -36,24 +36,24 @@
 				</view>
 				<view class="item-title">公司介绍</view>
 			</view>
-			<view class="cate-item flex" @click="openKf">
+			<!-- <view class="cate-item flex" @click="openKf">
 				<view class="img-wrapper flex">
 					<image src="../../static/index/in3.png" mode=""></image>
 				</view>
 				<view class="item-title">联系客服</view>
-			</view>
-			<view class="cate-item flex" @click="navto('/pages/index/storeList')">
+			</view> -->
+			<!-- <view class="cate-item flex" @click="navto('/pages/index/storeList')">
 				<view class="img-wrapper flex">
 					<image src="../../static/index/in6.png" mode=""></image>
 				</view>
 				<view class="item-title">本地门店</view>
-			</view>
-			<view class="cate-item flex" @click="navto('/pages/user/shareQrCode',1)">
+			</view> -->
+			<!-- <view class="cate-item flex" @click="navto('/pages/user/shareQrCode',1)">
 				<view class="img-wrapper flex">
 					<image src="../../static/index/in4.png" mode=""></image>
 				</view>
 				<view class="item-title">邀请好友</view>
-			</view>
+			</view> -->
 			<view class="cate-item flex" @click="navto('/pages/index/artDetail?id=2')">
 				<view class="img-wrapper flex">
 					<image src="../../static/index/in7.png" mode=""></image>
@@ -62,13 +62,13 @@
 			</view>
 		</view>
 		<!-- 分类 ed -->
-		<view class="jg">
+		<!-- <view class="jg">
 
-		</view>
-		<view class="hdlist" >
+		</view> -->
+		<!-- <view class="hdlist" >
 			<image src="../../static/index/ryc.png" @click="navTo('/pages/index/actionDetail?id=1')" mode="widthFix"></image>
 			<image src="../../static/index/xny.png" @click="navTo('/pages/index/actionDetail?id=2')" mode="widthFix"></image>
-		</view>
+		</view> -->
 		<!-- 商品列表 start -->
 		<view class="product-box">
 			<view class="product-tit flex">
@@ -441,7 +441,7 @@
 
 		.search-box {
 			justify-content: center;
-			width: 698rpx;
+			width: 100%;
 			height: 60rpx;
 			background: #EEEEEE;
 			// box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
@@ -544,7 +544,7 @@
 	}
 
 	.product-box {
-		margin-top: 20rpx;
+		// margin-top: 20rpx;
 		background: #ffffff;
 		padding: 26rpx 0 20rpx;
 		.product-tit {

+ 8 - 5
pages/user/award.vue

@@ -6,7 +6,9 @@
 				<view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
 				<view class="header">我的佣金</view>
 			</view>
-			<view class="content-bg"><image src="../../static/img/tg-bg.png" mode=""></image></view>
+			<view class="content-bg">
+				<!-- <image src="../../static/img/tg-bg.png" mode=""></image> -->
+			</view>
 			<view class="money-box">
 				<view class="money">{{ yj || 0 }}</view>
 				<view>我的佣金</view>
@@ -236,10 +238,11 @@ page {
 		right: 0;
 		width: 750rpx;
 		height: 480rpx;
-		image {
-			width: 100%;
-			height: 100%;
-		}
+		background-color: $base-color;
+		// image {
+		// 	width: 100%;
+		// 	height: 100%;
+		// }
 	}
 	.body-title {
 		height: 80rpx;

+ 153 - 2
pages/user/scoreAccumulate.vue

@@ -27,6 +27,12 @@
 				</scroll-view>
 			</swiper-item>
 		</swiper>
+		<view class="bottom-box">
+			<button class="add-btn up" @click="confirmShow">积分转佣金</button>
+			<navigator url="./setintegral">
+			<button class="add-btn yue" >积分转账</button>
+			</navigator>
+		</view>
 	</view>
 </template>
 
@@ -35,13 +41,21 @@
 import { integrallist } from '@/api/functionalUnit.js';
 import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 import empty from '@/components/empty';
+import {
+		getUserInfo
+	} from '@/api/user.js';
+import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import { setMoney } from '@/api/new.js';
 export default {
 	components: {
 		empty,
 		uniLoadMore
 	},
-	onReady() {
-		
+	computed: {
+		...mapState('user', ['userInfo'])
 	},
 	data() {
 		return {
@@ -61,8 +75,45 @@ export default {
 	onShow() {
 		// 载入积分数据
 		this.loadData();
+		this.loadBaseData();
 	},
 	methods: {
+		...mapMutations('user', ['setUserInfo']),
+		// 重新获取用户数据
+		loadBaseData() {
+			getUserInfo({})
+				.then(({
+					data
+				}) => {
+					console.log(data.nickname)
+					this.setUserInfo(data);
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+		confirmShow(){
+			uni.showModal({
+				title: '积分转佣金',
+				editable: true,
+				placeholderText:'请输入要转换的积分',
+				success: res => {
+					if(res.confirm){
+						setMoney({
+							brokerage:+res.content/10
+						}).then((e)=>{
+							uni.showToast({
+								title: '积分转佣金完成'
+							});
+						}).catch((err)=>{
+							console.log(err);
+						})
+					}
+				},
+				fail: () => {},
+				complete: () => {}
+			});
+		},
 		// 页面跳转
 		navto(e) {
 			uni.navigateTo({
@@ -197,4 +248,104 @@ page {
 		background-color: #ffffff;
 	}
 }
+.bottom-box{
+	position: absolute;
+	bottom: 0;
+	left:0;
+	right:0;
+	padding-bottom: 30rpx;
+}
+.add-btn {
+		color:#FFF;
+		&.yue{
+			background-color: #FFF;
+			color: #6B4216;
+		}
+		&.up {
+			background: linear-gradient(-90deg, #FAC545, #FFE000);
+		}
+
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 604rpx;
+		height: 90rpx;
+		margin: 0 auto;
+		margin-top: 30rpx;
+		font-size: $font-lg;
+		border-radius: 10rpx;
+
+	}
+	.popup-box {
+		width: 522rpx;
+		height: 605rpx;
+		background-color: #ffffff;
+		border-radius: 20rpx;
+		position: relative;
+		.title{
+			text-align: center;
+		}
+		.mian {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			// padding: 32rpx 32rpx;
+			background-color: #ffffff;
+			border-radius: 0 0 20rpx 20rpx;
+			text-align: center;
+	
+			.delivery {
+				font-size: 40rpx;
+				color: #333333;
+				display: flex;
+				align-items: center;
+				flex-direction: column;
+	
+				image {
+					margin-top: 48rpx;
+					width: 172rpx;
+					height: 160rpx;
+				}
+			}
+	
+			.nocancel {
+				font-size: 32rpx;
+				color: #333333;
+				margin-top: 14rpx;
+			}
+	
+			.comfirm-box {
+				margin-top: 52rpx;
+				display: flex;
+				// margin-bottom: 32rpx;
+	
+				// justify-content: space-around;
+				.cancel {
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					width: 197rpx;
+					height: 74rpx;
+					border: 1px solid #dcc786;
+					border-radius: 38rpx;
+	
+					font-size: 32rpx;
+					color: #605128;
+				}
+	
+				.comfirm {
+					margin-left: 32rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					width: 197rpx;
+					height: 74rpx;
+					background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
+					border-radius: 38px;
+					font-size: 32rpx;
+					color: #605128;
+				}
+			}
+		}
+	}
 </style>

+ 109 - 0
pages/user/setintegral.vue

@@ -0,0 +1,109 @@
+<template>
+	<view class="container">
+		<view class="row b-b">
+			<text class="tit">积分数</text>
+			<input class="input" v-model="account" type="text" placeholder="请填写要转积分数" placeholder-class="placeholder" />
+		</view>
+		<view class="row b-b">
+			<text class="tit">用户ID</text>
+			<input class="input" v-model="ID" type="text" placeholder="请填写对应用户ID" placeholder-class="placeholder" />
+		</view>
+		<button class="add-btn" :class="{'bg-gray':loding}" @click="loding?'':confirm()">提交</button>
+	</view>
+</template>
+
+<script>
+import { verify } from '@/api/login.js';
+import { setUserMoney } from '@/api/new.js';
+export default {
+	data() {
+		return {
+			account: '', //积分数
+			ID: '', //用户id
+		};
+	},
+	methods: {
+		confirm(e) {
+			this.loding = true;
+			uni.showLoading({
+				title: '转账中',
+				mask: true
+			});
+			setUserMoney({
+				num: this.account,
+				uid: this.ID
+			})
+				.then(({ data }) => {
+					uni.hideLoading()
+					this.loding = false;
+					this.$api.msg('转账成功');
+					this.account = '';
+					this.ID = '';
+				})
+				.catch(err => {
+					uni.hideLoading()
+					this.loding = false;
+					console.log(err);
+				});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: $page-color-base;
+}
+.container {
+	padding-top: 30rpx;
+}
+.row {
+	display: flex;
+	align-items: center;
+	position: relative;
+	padding: 0 30rpx;
+	height: 110rpx;
+	background: #fff;
+
+	.tit {
+		flex-shrink: 0;
+		width: 120rpx;
+		font-size: 30rpx;
+		color: $font-color-dark;
+	}
+	.input {
+		flex: 1;
+		font-size: 30rpx;
+		color: $font-color-dark;
+	}
+	.iconlocation {
+		font-size: 36rpx;
+		color: $font-color-light;
+	}
+}
+.add-btn {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 690rpx;
+	height: 80rpx;
+	margin: 60rpx auto;
+	font-size: $font-lg;
+	color: #fff;
+	background-color: $base-color;
+	border-radius: 10rpx;
+	// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
+}
+
+.bg-gray{
+	background-color: $color-gray;
+}
+.code {
+	color: #5dbc7c;
+	font-size: 23rpx;
+	border-left: 1px solid #eeeeee;
+	width: 150rpx;
+	flex-shrink: 0;
+	text-align: center;
+}
+</style>

+ 1 - 1
pages/user/shareQrCode.vue

@@ -88,7 +88,7 @@
 .erweima {
 	width: 300rpx;
 	position: absolute;
-	top: 948rpx;
+	top: 928rpx;
 	left: 0;
 	right: 0;
 	margin: auto;

+ 9 - 9
pages/user/team.vue

@@ -11,16 +11,16 @@
 				<view class="header">我的推广</view>
 			</view>
 			<view class="content-bg">
-				<image src="../../static/img/tg-bg.png" mode=""></image>
+				<!-- <image src="../../static/img/tg-bg.png" mode=""></image> -->
 			</view>
 			<view class="money-box">
 				<view class="money">{{ userInfo.spread_count|| '0' }}</view>
 				<view>我的推广人数</view>
 			</view>
-			<view class="money-box flex" style="padding: 20rpx 40rpx;" @click="navto('/pages/user/pushList')">
+			<!-- <view class="money-box flex" style="padding: 20rpx 40rpx;" @click="navto('/pages/user/pushList')">
 				<view>下级消费记录</view>
-				<!-- <view>直推人数:{{ztcount}}</view> -->
-			</view>
+				<view>直推人数:{{ztcount}}</view>
+			</view> -->
 		</view>
 		<!-- <view class="time-in">
 			<picker mode="date" @change="bindStartDateChange">
@@ -260,11 +260,11 @@
 			right: 0;
 			width: 750rpx;
 			height: 480rpx;
-
-			image {
-				width: 100%;
-				height: 100%;
-			}
+			background-color: $base-color;
+			// image {
+			// 	width: 100%;
+			// 	height: 100%;
+			// }
 		}
 
 		.body-title {

+ 11 - 11
pages/user/user.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="container">
 		<view class="vheigh"></view>
-		<view class="top-image">
+		<!-- <view class="top-image">
 			<image src="../../static/img/user-top.png" mode=""></image>
-		</view>
-		<view class="" style="height: 150rpx;"></view>
+		</view> -->
+		<view class=" padding-t-30"></view>
 		<view class="user-box">
 			<view class="user-info flex">
 				<image class="avatar" :src="userInfo.avatar" mode="" v-if="userInfo.avatar"
@@ -47,13 +47,13 @@
 			<view class="main flex">
 				<view class="oitem" @click="navTo('/pages/user/award')">
 					<view class="oitem-val">
-						{{ userInfo.brokerage_price || '0.00' }}
+						{{ +userInfo.brokerage_price || '0.00' }}
 					</view>
 					<view class="oitem-font">我的佣金</view>
 				</view>
 				<view class="oitem" @click="navTo('/pages/user/scoreAccumulate')">
 					<view class="oitem-val">
-						{{ userInfo.integral || '0.00' }}
+						{{ +userInfo.integral || '0.00' }}
 					</view>
 					<view class="oitem-font">我的积分</view>
 				</view>
@@ -101,13 +101,13 @@
 				</view>
 				<image src="../../static/icon/back.png" mode="" class="right-img"></image>
 			</view>
-			<!-- <view class="user-list flex" @click="navTo('/pages/user/shareQrCode')">
+			<view class="user-list flex" @click="navTo('/pages/user/shareQrCode')">
 				<image src="../../static/icon/gift.png" mode="" class="left-img"></image>
 				<view class="">
 					推广海报
 				</view>
 				<image src="../../static/icon/back.png" mode="" class="right-img"></image>
-			</view> -->
+			</view>
 			<view class="user-list flex" @click="navTo('/pages/set/address')">
 				<image src="../../static/icon/u2.png" mode="" class="left-img"></image>
 				<view class="">
@@ -115,13 +115,13 @@
 				</view>
 				<image src="../../static/icon/back.png" mode="" class="right-img"></image>
 			</view>
-			<view class="user-list flex" @click="openKf()" style="border-radius:0 0 20rpx 20rpx;">
+			<!-- <view class="user-list flex" @click="openKf()" style="border-radius:0 0 20rpx 20rpx;">
 				<image src="../../static/icon/u3.png" mode="" class="left-img"></image>
 				<view class="">
 					客服
 				</view>
 				<image src="../../static/icon/back.png" mode="" class="right-img"></image>
-			</view>
+			</view> -->
 			<view class="user-list flex" @click="navTo('/pages/set/userinfo')">
 				<image src="../../static/icon/u4.png" mode="" class="left-img"></image>
 				<view class="">
@@ -135,7 +135,7 @@
 		<view class="" style="height: 20rpx;">
 
 		</view>
-		<uni-popup ref="popupkf" type="center">
+		<!-- <uni-popup ref="popupkf" type="center">
 			<view class="popup-box">
 				<view class="img">
 					<image src="../../static/img/img009.png" mode=""></image>
@@ -152,7 +152,7 @@
 					</view>
 				</view>
 			</view>
-		</uni-popup>
+		</uni-popup> -->
 	</view>
 </template>
 <script>

BIN
static/img/sharebase.png


+ 1 - 1
store/index.js

@@ -6,7 +6,7 @@ Vue.use(Vuex)
 const store = new Vuex.Store({
 	state: {
 		// baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置 
-		baseURL:'http://hgd.liuniu946.com/',//请求地址配置 
+		baseURL:'http://hb.liuniukj.com',//请求地址配置 
 		urlFile:'/index',//项目部署所在文件夹
 		userInfo: {}, //登录信息
 		loginInterceptor:false,//是否打开强制登录

+ 1 - 1
uni.scss

@@ -4,7 +4,7 @@ $page-row-spacing: 30rpx;
 $page-color-base: #f8f8f8;//页面背景颜色
 $page-color-light: #f8f6fc;
 // 主题颜色
-$base-color: #ffb605;//项目颜色
+$base-color: #feca00;//项目颜色
 $box-shadow-color:#5dbc7c;//阴影颜色
 $font-color:#5dbc7c;//字体颜色
 $font-color-spec: #5dbc7c;//可操作文字颜色