cmy 9 months ago
parent
commit
9a89bfcfc8

+ 24 - 0
api/user.js

@@ -800,3 +800,27 @@ export function checkUser(data) {
 export function realName(data) {
 	return request.post('rname',data);
 }
+
+/*
+ * 绿积分记录
+ * */
+export function getGreedIntegralList(q) {
+	return request.get("green_integral/list", q);
+}
+/*
+ * 绿积分转账
+ * */
+export function setGreedIntegralList(q) {
+	return request.post("green/transfer", q);
+}
+/*
+ * 绿积分购买
+ * */
+export function getGreedUserList(q) {
+	return request.get("green/list", q);
+}
+
+export function energyExchange(q) {
+	return request.post("money/transfer", q);
+}
+

+ 7 - 1
manifest.json

@@ -223,7 +223,13 @@
     },
     "h5" : {
         "devServer" : {
-            "https" : false
+            "https" : true,
+            "proxy" : {
+                "/api" : {
+                    "target" : "https://sm121.qiniu1314.com",
+                    "changeOrigin" : true
+                }
+            }
         },
         "router" : {
             "mode" : "history",

+ 59 - 0
pages.json

@@ -392,6 +392,45 @@
 						"navigationStyle": "custom"
 					}
 				},
+				{
+				  "path": "user_integral/greed",
+				  "style": {
+				    "navigationBarTitleText": "绿积分详情"
+				
+				      // #ifdef MP
+				      ,
+				    "navigationBarTextStyle": "black",
+				    "navigationBarBackgroundColor": "#FFFFFF"
+				      // #endif
+				      ,
+				    "app-plus": {
+				      // #ifdef APP-PLUS
+				      "titleNView": {
+				        "type": "default"
+				      }
+				      // #endif
+				    }
+				  }
+				},
+				{
+				  "path": "user_integral/itemuser",
+				  "style": {
+				    "navigationBarTitleText": "购买绿积分"
+				      // #ifdef MP
+				      ,
+				    "navigationBarTextStyle": "black",
+				    "navigationBarBackgroundColor": "#FFFFFF"
+				      // #endif
+				      ,
+				    "app-plus": {
+				      // #ifdef APP-PLUS
+				      "titleNView": {
+				        "type": "default"
+				      }
+				      // #endif
+				    }
+				  }
+				},
 				{
 					"path": "user_integral_detail/index",
 					"style": {
@@ -500,6 +539,26 @@
 						}
 					}
 				},
+				{
+					"path": "user_cash/target",
+					"style": {
+						"navigationBarTitleText": "转账",
+						// #ifndef APP-PLUS
+						"navigationBarTextStyle": "white",
+						// #endif
+						// #ifdef APP-PLUS
+						"navigationBarTextStyle": "black",
+						// #endif
+						"navigationStyle": "custom",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
 				{
 					"path": "user_cash/status",
 					"style": {

+ 12 - 1
pages/goods/goods_list/index.vue

@@ -210,7 +210,9 @@
 					brand_id: '',
 					promotions_id: 0,
 					promotions_type:0,
-					defaultOrder:0
+					defaultOrder:0,
+					give_award_range:0,//报单商品
+					join_games:0,//抽奖商品
 				},
 				price: 0,
 				stock: 0,
@@ -253,6 +255,15 @@
 			this.$set(this.where, 'keyword', options.searchValue || '');
 			this.$set(this.where, 'productId', options.productId || '');
 			this.$set(this.where, 'brand_id', options.brandId || 0);
+			console.log(options)
+			// 判断是否报单商品
+			if(options.awardRange){
+				this.where.give_award_range=1;
+			}
+			// 判断是否抽奖商品
+			if(options.joinGame){
+				this.where.join_games=1;
+			}
 			if (options.promotions_type) {
 				this.where.promotions_type = options.promotions_type;
 				this.where.promotions_id = options.promotions_id;

+ 723 - 576
pages/user/index.vue

@@ -2,13 +2,34 @@
 	<!-- 个人中心模块 -->
 	<view class="user-page" :style="colorStyle">
 		<template v-if="userInfo && isObjectData(diyData)">
-			<user-member :userInfo="userInfo" :memberData="diyData.member" :orderAdminData="orderAdminData" :balanceStatus="balanceStatus" :isScrolling="isScrolling"></user-member>
-			<user-order :orderMenu="orderMenu" :orderAdminData="orderAdminData" :userInfo="userInfo" :memberData="diyData.member" :orderData="diyData.order"></user-order>
-			<user-order-static
-				v-if="isObjectData(orderAdminData) && orderAdminData.order.user_order"
-				:orderAdminData="orderAdminData.order"
-				:orderStaticData="diyData.orderStatic"
-			></user-order-static>
+			<user-member :userInfo="userInfo" :memberData="diyData.member" :orderAdminData="orderAdminData"
+				:balanceStatus="balanceStatus" :isScrolling="isScrolling"></user-member>
+			<view class="num-wrapper"
+				:class="[member_style==3?'unNum-wrapper':member_style==2?'Tnum-wrapper':'',((vip_type==2 && stu) || (vip_type==1 && memberStatus))?'':'height']"
+				v-if="userInfo.uid">
+				<!-- <view class="num-item" v-show="userInfo.balance_func_status"
+					@click="goMenuPage('/pages/users/user_money/index')">
+					<text class="num">{{userInfo.now_money || 0}}</text>
+					<view class="txt">余额</view>
+				</view> -->
+				<view class="num-item" @click="goMenuPage('/pages/users/user_integral/greed')">
+					<text class="num">{{userInfo.green_integral || 0}}</text>
+					<view class="txt">绿积分</view>
+				</view>
+				<!-- <view class="num-item" @click="goMenuPage('/pages/users/user_integral/integral')"> -->
+				<view class="num-item">
+					<text class="num">{{userInfo.award_range || 0}}</text>
+					<view class="txt">分红额度</view>
+				</view>
+				<!-- <view class="num-item" @click="goMenuPage('/pages/users/user_integral/integral')">
+					<text class="num">{{userInfo.static_integral || 0}}</text>
+					<view class="txt">消费分</view>
+				</view> -->
+			</view>
+			<user-order :orderMenu="orderMenu" :orderAdminData="orderAdminData" :userInfo="userInfo"
+				:memberData="diyData.member" :orderData="diyData.order"></user-order>
+			<user-order-static v-if="isObjectData(orderAdminData) && orderAdminData.order.user_order"
+				:orderAdminData="orderAdminData.order" :orderStaticData="diyData.orderStatic"></user-order-static>
 			<user-poster :posterData="diyData.poster"></user-poster>
 			<user-menu :menuData="diyData.menu"></user-menu>
 			<user-mer-menu v-if="diyData.merMenu.list.length" :merMenuData="diyData.merMenu"></user-mer-menu>
@@ -24,23 +45,26 @@
 			</view>
 		</template>
 		<!-- 店员推广码 extension-->
-		<view class="fixed-ct w-620 h-690 bg--w111-fff rd-24rpx ml-f310 mt-f400 z-1000" v-show="isextension" @touchmove.stop.prevent>
-		  <view class="fs-32 text-#333 fw-500 mt-48 mb-48 text-center">店员推广码</view>
-		  <view class="acea-row row-center-wrapper">
-			<!-- #ifdef MP -->
-			<image :src="extension.code" class="w-380 h-380" @click="downloadCode"></image>
-			<!-- #endif -->
-			<!-- #ifndef MP -->
-		    <view class="acea-row row-center-wrapper" @click="downloadCode">
-		      <w-qrcode id="hah" :options="extension" @generate="hello"></w-qrcode>
-		    </view>
-			<!-- #endif -->
-		    <view class="fs-26 text--w111-999 mt-40 w-312 text-center">如遇到扫码失败,</view>
-			<view class="fs-26 text--w111-999 mt-10 w-312 text-center">请将屏幕调至最亮重新扫码</view>
-		  </view>
-		  <view class="iconfont icon-ic_close1 text--w111-fff absolute fs-50 bottom-f100rpx left-50 ml-f25" @click="closeCode"></view>
+		<view class="fixed-ct w-620 h-690 bg--w111-fff rd-24rpx ml-f310 mt-f400 z-1000" v-show="isextension"
+			@touchmove.stop.prevent>
+			<view class="fs-32 text-#333 fw-500 mt-48 mb-48 text-center">店员推广码</view>
+			<view class="acea-row row-center-wrapper">
+				<!-- #ifdef MP -->
+				<image :src="extension.code" class="w-380 h-380" @click="downloadCode"></image>
+				<!-- #endif -->
+				<!-- #ifndef MP -->
+				<view class="acea-row row-center-wrapper" @click="downloadCode">
+					<w-qrcode id="hah" :options="extension" @generate="hello"></w-qrcode>
+				</view>
+				<!-- #endif -->
+				<view class="fs-26 text--w111-999 mt-40 w-312 text-center">如遇到扫码失败,</view>
+				<view class="fs-26 text--w111-999 mt-10 w-312 text-center">请将屏幕调至最亮重新扫码</view>
+			</view>
+			<view class="iconfont icon-ic_close1 text--w111-fff absolute fs-50 bottom-f100rpx left-50 ml-f25"
+				@click="closeCode"></view>
+		</view>
+		<view class="fixed-lt bg-w111-000-s111-80 w-full h-full z-999" v-show="isextension" @touchmove.stop.prevent>
 		</view>
-		<view class="fixed-lt bg-w111-000-s111-80 w-full h-full z-999" v-show="isextension" @touchmove.stop.prevent></view>
 		<pageFooter :style="colorStyle"></pageFooter>
 		<ewcomerPop v-if="isComerGift" :comerGift="comerGift" @comerPop="comerPop"></ewcomerPop>
 		<!-- #ifdef MP -->
@@ -49,603 +73,726 @@
 	</view>
 </template>
 <script>
-import { storeCardApi } from '@/api/store.js';
-import { newcomerGift } from '@/api/activity.js';
-import { copyRight } from '@/api/api.js';
-import { getMenuList, getUserInfo, setVisit, updateUserInfo, getRandCode, updateWechatInfo, getMenuData } from '@/api/user.js';
-import { wechatAuthV2, silenceAuth } from '@/api/public.js';
-import { toLogin } from '@/libs/login.js';
-import { mapState, mapGetters } from 'vuex';
-// #ifdef H5
-import Auth from '@/libs/wechat';
-// #endif
-import { HTTP_REQUEST_URL } from '@/config/app';
-const app = getApp();
-import ewcomerPop from '@/components/ewcomerPop/index.vue';
-import pageFooter from '@/components/pageFooter/index.vue';
-import dayjs from '@/plugin/dayjs/dayjs.min.js';
-import Routine from '@/libs/routine';
-import colors from '@/mixins/color';
-// #ifdef MP
-import editUserModal from '@/components/eidtUserModal/index.vue';
-// #endif
-import userMember from './components/member/index.vue';
-import userOrder from './components/order/index.vue';
-import userOrderStatic from './components/order_static/index.vue';
-import userMenu from './components/menus/index.vue';
-import userMerMenu from './components/merMenus/index.vue';
-import userStoreMenu from './components/storeMenus/index.vue';
-import userPoster from './components/poster/index.vue';
+	import {
+		storeCardApi
+	} from '@/api/store.js';
+	import {
+		newcomerGift
+	} from '@/api/activity.js';
+	import {
+		copyRight
+	} from '@/api/api.js';
+	import {
+		getMenuList,
+		getUserInfo,
+		setVisit,
+		updateUserInfo,
+		getRandCode,
+		updateWechatInfo,
+		getMenuData
+	} from '@/api/user.js';
+	import {
+		wechatAuthV2,
+		silenceAuth
+	} from '@/api/public.js';
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		mapState,
+		mapGetters
+	} from 'vuex';
+	// #ifdef H5
+	import Auth from '@/libs/wechat';
+	// #endif
+	import {
+		HTTP_REQUEST_URL
+	} from '@/config/app';
+	const app = getApp();
+	import ewcomerPop from '@/components/ewcomerPop/index.vue';
+	import pageFooter from '@/components/pageFooter/index.vue';
+	import dayjs from '@/plugin/dayjs/dayjs.min.js';
+	import Routine from '@/libs/routine';
+	import colors from '@/mixins/color';
+	// #ifdef MP
+	import editUserModal from '@/components/eidtUserModal/index.vue';
+	// #endif
+	import userMember from './components/member/index.vue';
+	import userOrder from './components/order/index.vue';
+	import userOrderStatic from './components/order_static/index.vue';
+	import userMenu from './components/menus/index.vue';
+	import userMerMenu from './components/merMenus/index.vue';
+	import userStoreMenu from './components/storeMenus/index.vue';
+	import userPoster from './components/poster/index.vue';
 
-export default {
-	components: {
-		userMember,
-		userOrder,
-		userOrderStatic,
-		userMenu,
-		userMerMenu,
-		userStoreMenu,
-		userPoster,
-		pageFooter,
-		ewcomerPop,
-		// #ifdef MP
-		editUserModal
-		// #endif
-	},
-	computed: {
-		...mapGetters({
-			cartNum: 'cartNum',
-			isLogin: 'isLogin'
-		})
-	},
-	filters: {},
-	mixins: [colors],
-	provide() {
-		return {
-			tapQrCode: this.tapQrCode,
-			bindPhone: this.bindPhone,
-			intoPage: this.intoPage,
-			goMenuPage: this.goMenuPage,
-			getMenuData: this.getMenuData,
-			goEdit: this.goEdit
-		};
-	},
-	data() {
-		return {
-			diyData: {},
-			orderAdminData: {},
+	export default {
+		components: {
+			userMember,
+			userOrder,
+			userOrderStatic,
+			userMenu,
+			userMerMenu,
+			userStoreMenu,
+			userPoster,
+			pageFooter,
+			ewcomerPop,
 			// #ifdef MP
-			getHeight: this.$util.getWXStatusHeight(),
+			editUserModal
 			// #endif
-			vipStatus: 0,
-			stu: false,
-			orderMenu: [
-				{
-					icon: '',
-					title: '待付款',
-					url: '/pages/goods/order_list/index?status=0'
-				},
-				{
-					icon: '',
-					title: '待发货',
-					url: '/pages/goods/order_list/index?status=1'
-				},
-				{
-					icon: '',
-					title: '待收货',
-					url: '/pages/goods/order_list/index?status=2'
+		},
+		computed: {
+			...mapGetters({
+				cartNum: 'cartNum',
+				isLogin: 'isLogin'
+			})
+		},
+		filters: {},
+		mixins: [colors],
+		provide() {
+			return {
+				tapQrCode: this.tapQrCode,
+				bindPhone: this.bindPhone,
+				intoPage: this.intoPage,
+				goMenuPage: this.goMenuPage,
+				getMenuData: this.getMenuData,
+				goEdit: this.goEdit
+			};
+		},
+		data() {
+			return {
+				diyData: {},
+				orderAdminData: {},
+				// #ifdef MP
+				getHeight: this.$util.getWXStatusHeight(),
+				// #endif
+				vipStatus: 0,
+				stu: false,
+				orderMenu: [{
+						icon: '',
+						title: '待付款',
+						url: '/pages/goods/order_list/index?status=0'
+					},
+					{
+						icon: '',
+						title: '待发货',
+						url: '/pages/goods/order_list/index?status=1'
+					},
+					{
+						icon: '',
+						title: '待收货',
+						url: '/pages/goods/order_list/index?status=2'
+					},
+					{
+						icon: '',
+						title: '待评价',
+						url: '/pages/goods/order_list/index?status=3'
+					},
+					{
+						icon: '',
+						title: '售后/退款',
+						url: '/pages/users/user_return_list/index'
+					}
+				],
+				imgUrls: [],
+				orderStatusNum: {},
+				userInfo: '',
+				showStatus: 1,
+				// #ifdef H5 || MP
+				pageHeight: '100%',
+				routineContact: 0,
+				// #endif
+				// #ifdef APP-PLUS
+				pageHeight: app.globalData.windowHeight,
+				// #endif
+				// #ifdef H5
+				isWeixin: Auth.isWeixin(),
+				//#endif
+				footerSee: false,
+				member_style: 1,
+				my_banner_status: 1,
+				menu_status: 1,
+				service_status: 1,
+				newcomer_status: 1,
+				isextension: false,
+				extension: {
+					code: '',
+					size: 380, // 二维码大小
+					level: 3, //等级 0~4
+					bgColor: '#FFFFFF', //二维码背景色 默认白色
+					color: ['#333', '#333'] //边框颜色支持渐变色
 				},
-				{
-					icon: '',
-					title: '待评价',
-					url: '/pages/goods/order_list/index?status=3'
+				imgHost: HTTP_REQUEST_URL,
+				copyRightText: '',
+				copyRightImg: '',
+				giftPic: '',
+				vip_type: 1,
+				newcomer_style: 1,
+				newList: [],
+				newBg: '',
+				comerGift: {},
+				isComerGift: false,
+				memberStatus: 0,
+				balanceStatus: 0, // 余额是否展示
+				editModal: false, // 编辑头像信息
+				isScrolling: false,
+				orderStyle: {
+					1: ['icon-ic_daifukuan12', 'icon-ic_daifahuo11', 'icon-ic_daishouhuo1', 'icon-ic_daipingjia1',
+						'icon-ic_daituikuan1'
+					],
+					2: ['icon-ic_daifukuan2', 'icon-ic_daifahuo2', 'icon-ic_daishouhuo2', 'icon-ic_daipingji2',
+						'icon-ic_daituikuan2'
+					],
+					3: ['icon-ic_daifukuan', 'icon-ic_daifahuo', 'icon-ic_daishouhuo', 'icon-ic_daipingjia',
+						'icon-ic_daituikuan'
+					]
 				},
-				{
-					icon: '',
-					title: '售后/退款',
-					url: '/pages/users/user_return_list/index'
-				}
-			],
-			imgUrls: [],
-			orderStatusNum: {},
-			userInfo: '',
-			showStatus: 1,
-			// #ifdef H5 || MP
-			pageHeight: '100%',
-			routineContact: 0,
+				codeImg: ''
+			};
+		},
+		created() {
+			let that = this;
+			// #ifdef MP
+			// 小程序静默授权
+			if (!this.$store.getters.isLogin) {
+				// Routine.getCode()
+				//   .then(code => {
+				//     Routine.silenceAuth(code).then(res => {
+				//       this.onLoadFun();
+				//     })
+				//   })
+				//   .catch(res => {
+				//     uni.hideLoading();
+				//   });
+			}
 			// #endif
 			// #ifdef APP-PLUS
-			pageHeight: app.globalData.windowHeight,
+			that.$set(that, 'pageHeight', app.globalData.windowHeight);
 			// #endif
-			// #ifdef H5
-			isWeixin: Auth.isWeixin(),
-			//#endif
-			footerSee: false,
-			member_style: 1,
-			my_banner_status: 1,
-			menu_status: 1,
-			service_status: 1,
-			newcomer_status: 1,
-			isextension: false,
-			extension: {
-				code: '',
-				size: 380, // 二维码大小
-				level: 3, //等级 0~4
-				bgColor: '#FFFFFF', //二维码背景色 默认白色
-				color: ['#333', '#333'] //边框颜色支持渐变色
-			},
-			imgHost: HTTP_REQUEST_URL,
-			copyRightText: '',
-			copyRightImg: '',
-			giftPic: '',
-			vip_type: 1,
-			newcomer_style: 1,
-			newList: [],
-			newBg: '',
-			comerGift: {},
-			isComerGift: false,
-			memberStatus: 0,
-			balanceStatus: 0, // 余额是否展示
-			editModal: false, // 编辑头像信息
-			isScrolling: false,
-			orderStyle: {
-				1: ['icon-ic_daifukuan12', 'icon-ic_daifahuo11', 'icon-ic_daishouhuo1', 'icon-ic_daipingjia1', 'icon-ic_daituikuan1'],
-				2: ['icon-ic_daifukuan2', 'icon-ic_daifahuo2', 'icon-ic_daishouhuo2', 'icon-ic_daipingji2', 'icon-ic_daituikuan2'],
-				3: ['icon-ic_daifukuan', 'icon-ic_daifahuo', 'icon-ic_daishouhuo', 'icon-ic_daipingjia', 'icon-ic_daituikuan']
-			},
-			codeImg:''
-		};
-	},
-	created() {
-		let that = this;
-		// #ifdef MP
-		// 小程序静默授权
-		if (!this.$store.getters.isLogin) {
-			// Routine.getCode()
-			//   .then(code => {
-			//     Routine.silenceAuth(code).then(res => {
-			//       this.onLoadFun();
-			//     })
-			//   })
-			//   .catch(res => {
-			//     uni.hideLoading();
-			//   });
-		}
-		// #endif
-		// #ifdef APP-PLUS
-		that.$set(that, 'pageHeight', app.globalData.windowHeight);
-		// #endif
-	},
-	async onLoad(option) {
-		if (this.isLogin) {
-			// this.getNewcomerGift();
-		}
-		// #ifdef H5
-		if (this.isLogin && Auth.isWeixin() && option.code) {
-			try {
-				let res = await updateWechatInfo({
-					code: option.code
-				});
-				this.userInfo.nickname = res.data.nickname;
-				this.userInfo.avatar = res.data.avatar;
-				this.userInfo.is_complete = 1;
-			} catch (e) {}
-		}
-		// #endif
-		this.colorData();
-	},
-	onReady() {},
-	onShow() {
-		if (!this.isLogin) {
-			this.userInfo = '';
-			toLogin();
-			return;
-		}
-		if (this.cartNum > 0) {
-			uni.setTabBarBadge({
-				index: 3,
-				text: this.cartNum > 99 ? '99+' : this.cartNum + ''
-			});
-		} else {
-			uni.hideTabBarRedDot({
-				index: 3
-			});
-		}
-		this.copyRightText = uni.getStorageSync('copyNameInfo');
-		this.copyRightImg = uni.getStorageSync('copyImageInfo');
-		uni.removeStorageSync('form_type_cart');
-		if (!this.copyRightText) {
-			this.getCopyRight();
-		}
-		let that = this;
-		// #ifdef APP-PLUS
-		uni.getSystemInfo({
-			success: function (res) {
-				that.pageHeight = res.windowHeight + 'px';
-			}
-		});
-		// #endif
-		if (that.isLogin) {
-			this.getUserInfo();
-			this.getMyMenus();
-			this.setVisit();
-			this.getMenuData();
-		}
-	},
-	// #ifdef MP || APP-PLUS
-	onPageScroll(e) {
-		if (e.scrollTop > 50) {
-			this.isScrolling = true;
-		} else if (e.scrollTop < 50) {
-			this.isScrolling = false;
-		}
-	},
-	// #endif
-	methods: {
-		hello(res){
-			this.codeImg = res.img.tempFilePath;
-		},
-		downloadCode() {
-		  let that = this
-		  // #ifdef H5
-		  var canvas = document.getElementById("hah").getElementsByTagName("canvas")
-		  var imgURL = canvas[0].toDataURL("image/png")
-		  var dlLink = document.createElement('a');
-		  dlLink.download = "店员推广码";
-		  dlLink.href = imgURL;
-		  dlLink.dataset.downloadurl = ["image/png", dlLink.download, dlLink.href].join(':');
-		  document.body.appendChild(dlLink);
-		  dlLink.click();
-		  document.body.removeChild(dlLink);
-		  // #endif
-		  // #ifdef MP
-		  uni.downloadFile({
-		  	url: that.extension.code, //仅为示例,并非真实的资源
-		  	success: (res) => {
-		  		if (res.statusCode === 200) {
-					uni.saveImageToPhotosAlbum({
-						filePath: res.tempFilePath,
-						success: function(res) {
-							that.$util.Tips({
-								title: '保存成功',
-								icon: 'success'
-							});
-						},
-						fail: function(res) {
-										console.log(res)
-							that.$util.Tips({
-								title: '保存失败'
-							});
-						}
-					});
-		  		}
-		  	}
-		  });
-		  // #endif
-		  // #ifdef APP-PLUS
-		  uni.saveImageToPhotosAlbum({
-		  	filePath: that.codeImg,
-		  	success: function(res) {
-		  		that.$util.Tips({
-		  			title: '保存成功',
-		  			icon: 'success'
-		  		});
-		  	},
-		  	fail: function(res) {
-		  		that.$util.Tips({
-		  			title: '保存失败'
-		  		});
-		  	}
-		  });
-		  // #endif
-		},
-		closeCode() {
-		  this.isextension = false
-		},
-		isObjectData(obj) {
-			return Object.keys(obj).length !== 0;
-		},
-		// #ifdef MP
-		editSuccess() {
-			this.editModal = false;
-			this.getUserInfo();
-		},
-		closeEdit() {
-			this.editModal = false;
 		},
-		// #endif
-		getCopyRight() {
-			copyRight()
-				.then((res) => {
-					let data = res.data;
-					if (!data.copyrightContext && !data.copyrightImage) {
-						data.copyrightImage = '/static/images/support.png';
-					}
-					uni.setStorageSync('copyNameInfo', data.copyrightContext);
-					uni.setStorageSync('copyImageInfo', data.copyrightImage);
-					this.copyRightText = data.copyrightContext;
-					this.copyRightImg = data.copyrightImage;
-				})
-				.catch((err) => {
-					return this.$util.Tips({
-						title: err.msg
-					});
-				});
-		},
-		// 查看订单
-		intoPage(url) {
+		async onLoad(option) {
 			if (this.isLogin) {
-				if (['/pages/users/user_vip/index', '/pages/annex/vip_grade_active/index'].includes(url) && !this.userInfo.member_func_status) {
-					this.$util.Tips({
-						title: '会员卡功能暂未开启'
+				// this.getNewcomerGift();
+			}
+			// #ifdef H5
+			if (this.isLogin && Auth.isWeixin() && option.code) {
+				try {
+					let res = await updateWechatInfo({
+						code: option.code
 					});
-				} else{
-					this.$util.JumpPath(url);
-				}
-			} else {
-				toLogin();
+					this.userInfo.nickname = res.data.nickname;
+					this.userInfo.avatar = res.data.avatar;
+					this.userInfo.is_complete = 1;
+				} catch (e) {}
 			}
+			// #endif
+			this.colorData();
 		},
-		// 编辑页面
-		goEdit() {
-			if (this.isLogin == false || !this.userInfo.uid) {
+		onReady() {},
+		onShow() {
+			if (!this.isLogin) {
+				this.userInfo = '';
 				toLogin();
+				return;
+			}
+			if (this.cartNum > 0) {
+				uni.setTabBarBadge({
+					index: 3,
+					text: this.cartNum > 99 ? '99+' : this.cartNum + ''
+				});
 			} else {
-				// #ifdef MP
-				if (this.userInfo.is_default_avatar) {
-					this.editModal = true;
-					return;
-				}
-				// #endif
-				uni.navigateTo({
-					url: '/pages/users/user_set/index'
+				uni.hideTabBarRedDot({
+					index: 3
 				});
 			}
-		},
-		goDetail(item) {
-			uni.navigateTo({
-				url: `/pages/goods_details/index?id=${item.id}&fromPage='newVip'`
+			this.copyRightText = uni.getStorageSync('copyNameInfo');
+			this.copyRightImg = uni.getStorageSync('copyImageInfo');
+			uni.removeStorageSync('form_type_cart');
+			if (!this.copyRightText) {
+				this.getCopyRight();
+			}
+			let that = this;
+			// #ifdef APP-PLUS
+			uni.getSystemInfo({
+				success: function(res) {
+					that.pageHeight = res.windowHeight + 'px';
+				}
 			});
+			// #endif
+			if (that.isLogin) {
+				this.getUserInfo();
+				this.getMyMenus();
+				this.setVisit();
+				this.getMenuData();
+			}
 		},
-		comerPop() {
-			this.isComerGift = false;
-		},
-		getNewcomerGift() {
-			if (uni.getStorageSync('newcomerGift')) {
-				return (this.isComerGift = false);
+		// #ifdef MP || APP-PLUS
+		onPageScroll(e) {
+			if (e.scrollTop > 50) {
+				this.isScrolling = true;
+			} else if (e.scrollTop < 50) {
+				this.isScrolling = false;
 			}
-			newcomerGift()
-				.then((res) => {
-					this.comerGift = res.data;
-					if (Object.prototype.toString.call(this.comerGift) == '[object Object]') {
-						if (res.data.coupon_count || res.data.product_count || res.data.register_give_money || res.data.first_order_discount || res.data.register_give_integral) {
-							uni.setStorageSync('newcomerGift', true);
-							this.isComerGift = true;
+		},
+		// #endif
+		methods: {
+			hello(res) {
+				this.codeImg = res.img.tempFilePath;
+			},
+			downloadCode() {
+				let that = this
+				// #ifdef H5
+				var canvas = document.getElementById("hah").getElementsByTagName("canvas")
+				var imgURL = canvas[0].toDataURL("image/png")
+				var dlLink = document.createElement('a');
+				dlLink.download = "店员推广码";
+				dlLink.href = imgURL;
+				dlLink.dataset.downloadurl = ["image/png", dlLink.download, dlLink.href].join(':');
+				document.body.appendChild(dlLink);
+				dlLink.click();
+				document.body.removeChild(dlLink);
+				// #endif
+				// #ifdef MP
+				uni.downloadFile({
+					url: that.extension.code, //仅为示例,并非真实的资源
+					success: (res) => {
+						if (res.statusCode === 200) {
+							uni.saveImageToPhotosAlbum({
+								filePath: res.tempFilePath,
+								success: function(res) {
+									that.$util.Tips({
+										title: '保存成功',
+										icon: 'success'
+									});
+								},
+								fail: function(res) {
+									console.log(res)
+									that.$util.Tips({
+										title: '保存失败'
+									});
+								}
+							});
 						}
 					}
-				})
-				.catch((err) => {
-					return this.$util.Tips({
-						title: err
-					});
 				});
-		},
-		tapQrCode() {
-			uni.navigateTo({
-				url: '/pages/users/user_member_code/index'
-			});
-		},
-		getRoutineUserInfo(e) {
-			updateUserInfo({
-				userInfo: e.detail.userInfo
-			})
-				.then((res) => {
-					this.getUserInfo();
-					return this.$util.Tips('更新用户信息成功');
-				})
-				.catch((err) => {
-					return this.$util.Tips(err);
-				});
-		},
-		// 记录会员访问
-		setVisit() {
-			setVisit({
-				url: '/pages/user/index'
-			}).then((res) => {});
-		},
-		// 打开授权
-		openAuto() {
-			toLogin();
-		},
-		// 授权回调
-		onLoadFun(e) {
-			this.getUserInfo(e);
-			this.getMyMenus();
-			this.setVisit();
-		},
-		// 绑定手机
-		bindPhone() {
-			uni.navigateTo({
-				url: '/pages/users/user_phone/index'
-			});
-		},
-		// 获取行销数据
-		getMenuData() {
-			getMenuData().then((res) => {
-				this.orderAdminData = res.data;
-			});
-		},
-		/**
-		 * 获取个人用户信息
-		 */
-		getUserInfo() {
-			let that = this;
-			getUserInfo().then((res) => {
-				that.userInfo = res.data;
-				that.stu = res.data.svip_open;
-				that.balanceStatus = res.data.balance_func_status;
-				that.memberStatus = parseInt(res.data.member_func_status);
-				that.vipStatus = res.data.vip_status;
-				that.$store.commit('SETUID', res.data.uid);
-				that.$store.commit('UPDATE_USERINFO', res.data);
-				that.orderMenu.forEach((item, index) => {
-					switch (item.title) {
-						case '待付款':
-						this.$set(item,'num',res.data.orderStatusNum.unpaid_count);
-							break;
-						case '待发货':
-						this.$set(item,'num',res.data.orderStatusNum.unshipped_count);
-							break;
-						case '待收货':
-						this.$set(item,'num',res.data.orderStatusNum.received_count);
-							break;
-						case '待评价':
-						this.$set(item,'num',res.data.orderStatusNum.evaluated_count);
-							break;
-						case '售后/退款':
-						this.$set(item,'num',res.data.orderStatusNum.refunding_count);
-							break;
+				// #endif
+				// #ifdef APP-PLUS
+				uni.saveImageToPhotosAlbum({
+					filePath: that.codeImg,
+					success: function(res) {
+						that.$util.Tips({
+							title: '保存成功',
+							icon: 'success'
+						});
+					},
+					fail: function(res) {
+						that.$util.Tips({
+							title: '保存失败'
+						});
 					}
 				});
-			});
-		},
-		getMyMenus: function () {
-			let that = this;
-			getMenuList().then((res) => {
-				this.diyData = res.data.diy_data;
-				this.switchTab(this.diyData.order.style);
-				this.my_banner_status = res.data.diy_data.my_banner_status;
-				this.menu_status = res.data.diy_data.menu_status;
-				this.service_status = res.data.diy_data.service_status;
-				this.vip_type = res.data.diy_data.vip_type;
-				this.newcomer_style = res.data.diy_data.newcomer_style;
-				this.newcomer_status = res.data.diy_data.newcomer_status;
-				this.imgUrls = res.data.routine_my_banner;
-				this.routineContact = Number(res.data.routine_contact_type);
-			});
-		},
-		switchTab(style) {
-			this.orderMenu.forEach((item, index) => {
-				item.icon = this.orderStyle[style][index];
-			});
-		},
-		goMenuPage(url, name) {
-			console.log(url);
-			if (this.isLogin) {
-				let arr = url.split('@APPID=');
-				if (arr.length > 1) {
-					//#ifdef MP
-					uni.navigateToMiniProgram({
-						appId: arr[arr.length - 1], // 此为生活缴费appid
-						path: arr[0], // 此为生活缴费首页路径
-						envVersion: 'release',
-						success: (res) => {
-							console.log('打开成功', res);
-						},
-						fail: (err) => {
-							console.log('sgdhgf', err);
+				// #endif
+			},
+			closeCode() {
+				this.isextension = false
+			},
+			isObjectData(obj) {
+				return Object.keys(obj).length !== 0;
+			},
+			// #ifdef MP
+			editSuccess() {
+				this.editModal = false;
+				this.getUserInfo();
+			},
+			closeEdit() {
+				this.editModal = false;
+			},
+			// #endif
+			getCopyRight() {
+				copyRight()
+					.then((res) => {
+						let data = res.data;
+						if (!data.copyrightContext && !data.copyrightImage) {
+							data.copyrightImage = '/static/images/support.png';
 						}
+						uni.setStorageSync('copyNameInfo', data.copyrightContext);
+						uni.setStorageSync('copyImageInfo', data.copyrightImage);
+						this.copyRightText = data.copyrightContext;
+						this.copyRightImg = data.copyrightImage;
+					})
+					.catch((err) => {
+						return this.$util.Tips({
+							title: err.msg
+						});
 					});
-					//#endif
-					//#ifndef MP
-					this.Tips({
-						title: 'h5与app端不支持跳转外部小程序'
-					});
-					//#endif
-				} else {
-					if (url == '/pages/extension/customer_list/chat' || url == 'https://chat.crmeb.net/chat/mobile') {
-						this.$util.getCustomer(this.userInfo);
+			},
+			// 查看订单
+			intoPage(url) {
+				if (this.isLogin) {
+					if (['/pages/users/user_vip/index', '/pages/annex/vip_grade_active/index'].includes(url) && !this
+						.userInfo.member_func_status) {
+						this.$util.Tips({
+							title: '会员卡功能暂未开启'
+						});
 					} else {
-						if (url.indexOf('http') === -1) {
-							// #ifdef H5
-							if (name && name === '订单核销') {
-								return (window.location.href = `${location.origin}${url}`);
+						this.$util.JumpPath(url);
+					}
+				} else {
+					toLogin();
+				}
+			},
+			// 编辑页面
+			goEdit() {
+				if (this.isLogin == false || !this.userInfo.uid) {
+					toLogin();
+				} else {
+					// #ifdef MP
+					if (this.userInfo.is_default_avatar) {
+						this.editModal = true;
+						return;
+					}
+					// #endif
+					uni.navigateTo({
+						url: '/pages/users/user_set/index'
+					});
+				}
+			},
+			goDetail(item) {
+				uni.navigateTo({
+					url: `/pages/goods_details/index?id=${item.id}&fromPage='newVip'`
+				});
+			},
+			comerPop() {
+				this.isComerGift = false;
+			},
+			getNewcomerGift() {
+				if (uni.getStorageSync('newcomerGift')) {
+					return (this.isComerGift = false);
+				}
+				newcomerGift()
+					.then((res) => {
+						this.comerGift = res.data;
+						if (Object.prototype.toString.call(this.comerGift) == '[object Object]') {
+							if (res.data.coupon_count || res.data.product_count || res.data.register_give_money || res
+								.data.first_order_discount || res.data.register_give_integral) {
+								uni.setStorageSync('newcomerGift', true);
+								this.isComerGift = true;
 							}
-							// #endif
-							// #ifdef MP
-							if (url != '#' && url == '/pages/users/user_set/index') {
-								uni.openSetting({
-									success: function (res) {}
-								});
+						}
+					})
+					.catch((err) => {
+						return this.$util.Tips({
+							title: err
+						});
+					});
+			},
+			tapQrCode() {
+				uni.navigateTo({
+					url: '/pages/users/user_member_code/index'
+				});
+			},
+			getRoutineUserInfo(e) {
+				updateUserInfo({
+						userInfo: e.detail.userInfo
+					})
+					.then((res) => {
+						this.getUserInfo();
+						return this.$util.Tips('更新用户信息成功');
+					})
+					.catch((err) => {
+						return this.$util.Tips(err);
+					});
+			},
+			// 记录会员访问
+			setVisit() {
+				setVisit({
+					url: '/pages/user/index'
+				}).then((res) => {});
+			},
+			// 打开授权
+			openAuto() {
+				toLogin();
+			},
+			// 授权回调
+			onLoadFun(e) {
+				this.getUserInfo(e);
+				this.getMyMenus();
+				this.setVisit();
+			},
+			// 绑定手机
+			bindPhone() {
+				uni.navigateTo({
+					url: '/pages/users/user_phone/index'
+				});
+			},
+			// 获取行销数据
+			getMenuData() {
+				getMenuData().then((res) => {
+					this.orderAdminData = res.data;
+				});
+			},
+			/**
+			 * 获取个人用户信息
+			 */
+			getUserInfo() {
+				let that = this;
+				getUserInfo().then((res) => {
+					that.userInfo = res.data;
+					that.stu = res.data.svip_open;
+					that.balanceStatus = res.data.balance_func_status;
+					that.memberStatus = parseInt(res.data.member_func_status);
+					that.vipStatus = res.data.vip_status;
+					that.$store.commit('SETUID', res.data.uid);
+					that.$store.commit('UPDATE_USERINFO', res.data);
+					that.orderMenu.forEach((item, index) => {
+						switch (item.title) {
+							case '待付款':
+								this.$set(item, 'num', res.data.orderStatusNum.unpaid_count);
+								break;
+							case '待发货':
+								this.$set(item, 'num', res.data.orderStatusNum.unshipped_count);
+								break;
+							case '待收货':
+								this.$set(item, 'num', res.data.orderStatusNum.received_count);
+								break;
+							case '待评价':
+								this.$set(item, 'num', res.data.orderStatusNum.evaluated_count);
+								break;
+							case '售后/退款':
+								this.$set(item, 'num', res.data.orderStatusNum.refunding_count);
+								break;
+						}
+					});
+				});
+			},
+			getMyMenus: function() {
+				let that = this;
+				getMenuList().then((res) => {
+					this.diyData = res.data.diy_data;
+					this.switchTab(this.diyData.order.style);
+					this.my_banner_status = res.data.diy_data.my_banner_status;
+					this.menu_status = res.data.diy_data.menu_status;
+					this.service_status = res.data.diy_data.service_status;
+					this.vip_type = res.data.diy_data.vip_type;
+					this.newcomer_style = res.data.diy_data.newcomer_style;
+					this.newcomer_status = res.data.diy_data.newcomer_status;
+					this.imgUrls = res.data.routine_my_banner;
+					this.routineContact = Number(res.data.routine_contact_type);
+				});
+			},
+			switchTab(style) {
+				this.orderMenu.forEach((item, index) => {
+					item.icon = this.orderStyle[style][index];
+				});
+			},
+			goMenuPage(url, name) {
+				console.log(url);
+				if (this.isLogin) {
+					let arr = url.split('@APPID=');
+					if (arr.length > 1) {
+						//#ifdef MP
+						uni.navigateToMiniProgram({
+							appId: arr[arr.length - 1], // 此为生活缴费appid
+							path: arr[0], // 此为生活缴费首页路径
+							envVersion: 'release',
+							success: (res) => {
+								console.log('打开成功', res);
+							},
+							fail: (err) => {
+								console.log('sgdhgf', err);
 							}
-							// #endif
-							if (url == '/pages/store_spread/index') {
-								storeCardApi()
-									.then((res) => {
-										this.isextension = true;
-										this.$nextTick(function () {
-											this.extension.code = res.data.url;
-										});
-									})
-									.catch((err) => {
-										uni.hideLoading();
-										this.$util.Tips({
-											title: err
+						});
+						//#endif
+						//#ifndef MP
+						this.Tips({
+							title: 'h5与app端不支持跳转外部小程序'
+						});
+						//#endif
+					} else {
+						if (url == '/pages/extension/customer_list/chat' || url == 'https://chat.crmeb.net/chat/mobile') {
+							this.$util.getCustomer(this.userInfo);
+						} else {
+							if (url.indexOf('http') === -1) {
+								// #ifdef H5
+								if (name && name === '订单核销') {
+									return (window.location.href = `${location.origin}${url}`);
+								}
+								// #endif
+								// #ifdef MP
+								if (url != '#' && url == '/pages/users/user_set/index') {
+									uni.openSetting({
+										success: function(res) {}
+									});
+								}
+								// #endif
+								if (url == '/pages/store_spread/index') {
+									storeCardApi()
+										.then((res) => {
+											this.isextension = true;
+											this.$nextTick(function() {
+												this.extension.code = res.data.url;
+											});
+										})
+										.catch((err) => {
+											uni.hideLoading();
+											this.$util.Tips({
+												title: err
+											});
 										});
+								}
+								if (
+									['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart',
+										'/pages/user/index', '/pages/store_cate/store_cate', '/pages/index/index'
+									].indexOf(url) == -1
+								) {
+									uni.navigateTo({
+										url: url
 									});
-							}
-							if (
-								['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart', '/pages/user/index', '/pages/store_cate/store_cate', '/pages/index/index'].indexOf(url) == -1
-							) {
-								uni.navigateTo({
-									url: url
-								});
+								} else {
+									uni.reLaunch({
+										url: url
+									});
+								}
 							} else {
-								uni.reLaunch({
-									url: url
+								// #ifdef H5
+								this.$util.JumpPath(url);
+								// #endif
+								// #ifndef H5
+								uni.navigateTo({
+									url: `/pages/annex/web_view/index?url=${url}`
 								});
+								// #endif
 							}
-						} else {
-							// #ifdef H5
-							this.$util.JumpPath(url);
-							// #endif
-							// #ifndef H5
-							uni.navigateTo({
-								url: `/pages/annex/web_view/index?url=${url}`
-							});
-							// #endif
 						}
 					}
 				}
 			}
 		}
-	}
-};
+	};
 </script>
 
 <style lang="scss" scoped>
-.footer-placeholder {
-	height: calc(98rpx+ constant(safe-area-inset-bottom));
-	height: calc(98rpx + env(safe-area-inset-bottom));
-	height: 98rpx;
-}
-.user-page {
-	padding-bottom: calc(100rpx+ constant(safe-area-inset-bottom));
-	padding-bottom: calc(100rpx + env(safe-area-inset-bottom));
-	padding-bottom: 100rpx;
-}
-.copy_right {
-	text-align: center;
-	color: #ccc;
-	font-size: 22rpx;
-	margin-top: 40rpx;
-	.copyRightImg {
-		width: 219rpx;
-		height: 74rpx;
-		margin: 16rpx auto;
-		display: block;
+	.footer-placeholder {
+		height: calc(98rpx+ constant(safe-area-inset-bottom));
+		height: calc(98rpx + env(safe-area-inset-bottom));
+		height: 98rpx;
 	}
-	.support {
-		width: 219rpx;
-		height: 74rpx;
-		margin: 54rpx auto;
-		display: block;
+
+	.user-page {
+		padding-bottom: calc(100rpx+ constant(safe-area-inset-bottom));
+		padding-bottom: calc(100rpx + env(safe-area-inset-bottom));
+		padding-bottom: 100rpx;
 	}
-	.copyRightText {
-		margin-top: 0rpx;
+
+	.copy_right {
+		text-align: center;
 		color: #ccc;
-		font-size: 20rpx;
-		margin-bottom: 20rpx;
+		font-size: 22rpx;
+		margin-top: 40rpx;
+
+		.copyRightImg {
+			width: 219rpx;
+			height: 74rpx;
+			margin: 16rpx auto;
+			display: block;
+		}
+
+		.support {
+			width: 219rpx;
+			height: 74rpx;
+			margin: 54rpx auto;
+			display: block;
+		}
+
+		.copyRightText {
+			margin-top: 0rpx;
+			color: #ccc;
+			font-size: 20rpx;
+			margin-bottom: 20rpx;
+		}
+	}
+
+	.num-wrapper {
+		background-color: #fff;
+		z-index: 29;
+		position: relative;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		margin-top: 22rpx;
+		color: #333;
+		margin: 20rpx 20rpx 20rpx 20rpx;
+		border-radius: 16rpx;
+		height: 160rpx;
+
+		&.on {
+			height: 128rpx;
+			margin-top: -68rpx;
+
+			.gift {
+				color: var(--view-theme);
+				margin-left: 10rpx;
+				font-weight: bold;
+			}
+		}
+
+		.img {
+			margin-left: 38rpx;
+			width: 76rpx;
+			height: 68rpx;
+		}
+
+		.text {
+			font-size: 28rpx;
+			font-weight: 400;
+			color: #333333;
+			margin-left: -60rpx;
+		}
+
+		.btn-login {
+			width: 144rpx;
+			height: 56rpx;
+			// background: linear-gradient(270deg, #FF7931 0%, #E93323 100%);
+			background-color: var(--view-theme);
+			border-radius: 28rpx;
+			text-align: center;
+			line-height: 56rpx;
+			margin-right: 32rpx;
+			font-size: 28rpx;
+			font-weight: 500;
+			color: #FFFFFF;
+
+		}
+
+		.num-item {
+			width: 33.33%;
+			text-align: center;
+			flex-grow: 1;
+
+			&~.num-item {
+				position: relative;
+
+				&:before {
+					content: '';
+					position: absolute;
+					width: 1rpx;
+					height: 28rpx;
+					top: 50%;
+					margin-top: -14rpx;
+					background-color: rgba(255, 255, 255, 0.4);
+					left: 0;
+				}
+			}
+
+			.num {
+				font-size: 36rpx;
+				font-weight: bold;
+			}
+
+			.txt {
+				margin-top: 8rpx;
+				font-size: 26rpx;
+				color: #555;
+			}
+		}
 	}
-}
-</style>
+</style>

+ 332 - 0
pages/users/user_cash/target.vue

@@ -0,0 +1,332 @@
+<template>
+	<view :style="colorStyle">
+		<view class='cash-withdrawal'>
+			<view class='wrapper'>
+				<view class='list'>
+					<form @submit="subCash">
+						<!-- <view class='item acea-row row-between-wrapper'>
+							<view class='name'>持卡人</view>
+							<view class='input'><input placeholder='请输入持卡人姓名' placeholder-class='placeholder'
+									name="name"
+									onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;"></input>
+							</view>
+						</view> -->
+						<view class='item acea-row row-between-wrapper'>
+							<view class='name'>用户ID</view>
+							<view class='input'><input type='number' placeholder='请填写转账用户ID' placeholder-class='placeholder'
+									name="uid"></input></view>
+						</view>
+						<!-- <view class='item acea-row row-between-wrapper'>
+							<view class='name'>开户行</view>
+							<view class='input'><input placeholder='请输入开户行名称' placeholder-class='placeholder'
+									name="bankname"
+									onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;"></input>
+							</view>
+						</view> -->
+						<view class='item acea-row row-between-wrapper'>
+							<view class='name'>转账佣金金额</view>
+							<view class='input'><input v-model="allMoney" @input='inputNum' placeholder='需要转账的佣金金额' placeholder-class='placeholder' name="num"
+									type='digit'></input></view>
+						</view>
+						<view class='tip'>
+							当前可转佣金:<text class="price">{{userInfo.commissionCount}}</text>
+						<!-- 	时价:<text  class="price">{{stock_price}}</text> -->
+						</view>
+						<!-- <view class='tip'>
+							手续费:<text class="price">{{withdraw_fee}}%</text>实际到账:<text
+								class="price">{{true_money}}</text>
+						</view> -->
+						<button formType="submit" class='bnt bg-color'>立即转换</button>
+					</form>
+				</view>
+			</view>
+		</view>
+		<home v-if="navigation"></home>
+	</view>
+</template>
+
+<script>
+	import {
+		energyExchange,
+		// energyBank,
+		getUserInfo
+	} from '@/api/user.js';
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		mapGetters
+	} from "vuex";
+	import colors from '@/mixins/color.js';
+	import home from '@/components/home';
+import { userInfo } from 'os';
+	export default {
+		components: {
+			home
+		},
+		mixins: [colors],
+		data() {
+			return {
+				minPrice: 0.00, //最低提现金额
+				userInfo: [],
+				prevent: true, //避免重复提交成功多次
+				moneyMaxLeng: 8,
+				withdraw_fee: '0',
+				true_money: 0,
+				allMoney: '', //保存当前提现金额
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		watch: {
+			isLogin: {
+				handler: function(newV, oldV) {
+					if (newV) {
+						this.getUserInfo();
+						// this.getUserExtractBank();
+					}
+				},
+				deep: true
+			}
+		},
+		onLoad() {
+			if (this.isLogin) {
+				this.getUserInfo();
+				// this.getUserExtractBank();
+			} else {
+				toLogin()
+			}
+		},
+		methods: {
+			inputNum: async function(e) {
+				let val = e.detail.value;
+				let dot = val.indexOf('.');
+				if (dot > -1) {
+					this.moneyMaxLeng = dot + 3;
+				} else {
+					this.moneyMaxLeng = 8
+				}
+				try {
+					this.true_money = +((val - val*this.withdraw_fee/100)/this.stock_price).toFixed(2);
+					// console.log(this.true_money,'this.true_money');
+				} catch (e) {
+					uni.showToast({
+						title: e,
+						icon: "error"
+					});
+					//TODO handle the exception
+				}
+
+			},
+			// getUserExtractBank: function() {
+			// 	let that = this;
+			// 	energyBank().then(res => {
+			// 		that.minPrice = res.data.minEnergy;
+			// 		that.stock_price = res.data.stock_price;
+			// 		that.withdraw_fee = res.data.exchange_fee;
+			// 	});
+			// },
+			/**
+			 * 获取个人用户信息
+			 */
+			getUserInfo: function() {
+				let that = this;
+				getUserInfo().then(res => {
+					that.userInfo = res.data;
+				})
+			},
+			subCash: function(e) {
+				let that = this,
+					value = e.detail.value;
+				if (value.uid.length == 0) return that.$util.Tips({
+					title: '请填写收款用户UID'
+				});
+				if (value.num.length == 0) return that.$util.Tips({
+					title: '请填写转账金额'
+				});
+				if(value.num>this.userInfo.commissionCount){
+					return that.$util.Tips({
+						title: '转账佣金不可大于可转账佣金'
+					});
+				}
+				energyExchange({
+					...value,
+				}).then(res => {
+					return this.$util.Tips({
+						title: res.msg,
+						icon: 'success'
+					}, {
+						url: '/pages/user/index',
+						tab: 2
+					});
+				}).catch(err => {
+					setTimeout(e => {
+						this.prevent = true
+					}, 1500)
+					return this.$util.Tips({
+						title: err
+					});
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff !important;
+	}
+
+	.fontcolor {
+		color: var(--view-theme) !important;
+	}
+
+	.cash-withdrawal .nav {
+		height: 130rpx;
+		box-shadow: 0 10rpx 10rpx #f8f8f8;
+	}
+
+	.cash-withdrawal .nav .item {
+		font-size: 26rpx;
+		flex: 1;
+		text-align: center;
+	}
+
+	.cash-withdrawal .nav .item~.item {
+		border-left: 1px solid #f0f0f0;
+	}
+
+	.cash-withdrawal .nav .item .iconfont {
+		width: 40rpx;
+		height: 40rpx;
+		border-radius: 50%;
+		border: 2rpx solid var(--view-theme);
+		text-align: center;
+		line-height: 37rpx;
+		margin: 0 auto 6rpx auto;
+		font-size: 22rpx;
+		box-sizing: border-box;
+	}
+
+	.cash-withdrawal .nav .item .iconfont.on {
+		background-color: var(--view-theme);
+		color: #fff;
+		border-color: var(--view-theme);
+	}
+
+	.cash-withdrawal .nav .item .line {
+		width: 2rpx;
+		height: 20rpx;
+		margin: 0 auto;
+		transition: height 0.3s;
+	}
+
+	.cash-withdrawal .nav .item .line.on {
+		height: 39rpx;
+	}
+
+	.cash-withdrawal .wrapper .list {
+		padding: 0 30rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item {
+		border-bottom: 1rpx solid #eee;
+		min-height: 28rpx;
+		font-size: 30rpx;
+		color: #333;
+		padding: 39rpx 0;
+	}
+
+	.cash-withdrawal .wrapper .list .item .name {
+		width: 130rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item .input {
+		width: 505rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item .input .placeholder {
+		color: #bbb;
+	}
+
+	.cash-withdrawal .wrapper .list .item .picEwm,
+	.cash-withdrawal .wrapper .list .item .pictrue {
+		width: 140rpx;
+		height: 140rpx;
+		border-radius: 3rpx;
+		position: relative;
+		margin-right: 23rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item .picEwm image {
+		width: 100%;
+		height: 100%;
+		border-radius: 3rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item .picEwm .icon-guanbi1 {
+		position: absolute;
+		right: -14rpx;
+		top: -16rpx;
+		font-size: 40rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item .pictrue {
+		border: 1px solid rgba(221, 221, 221, 1);
+		font-size: 22rpx;
+		color: #BBBBBB;
+	}
+
+	.cash-withdrawal .wrapper .list .item .pictrue .icon-icon25201 {
+		font-size: 47rpx;
+		color: #DDDDDD;
+		margin-bottom: 3px;
+	}
+
+	.cash-withdrawal .wrapper .list .tip {
+		font-size: 26rpx;
+		color: #999;
+		margin-top: 25rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .bnt {
+		font-size: 32rpx;
+		color: #fff;
+		width: 690rpx;
+		height: 90rpx;
+		text-align: center;
+		border-radius: 50rpx;
+		line-height: 90rpx;
+		margin: 64rpx auto;
+	}
+
+	.cash-withdrawal .wrapper .list .tip2 {
+		font-size: 26rpx;
+		color: #999;
+		text-align: center;
+		margin: 44rpx 0 20rpx 0;
+	}
+
+	.cash-withdrawal .wrapper .list .value {
+		height: 135rpx;
+		line-height: 135rpx;
+		border-bottom: 1rpx solid #eee;
+		width: 690rpx;
+		margin: 0 auto;
+	}
+
+	.cash-withdrawal .wrapper .list .value input {
+		font-size: 80rpx;
+		color: #282828;
+		height: 135rpx;
+		text-align: center;
+	}
+
+	.cash-withdrawal .wrapper .list .value .placeholder2 {
+		color: #bbb;
+	}
+
+	.price {
+		color: var(--view-priceColor);
+		margin-right: 20rpx;
+	}
+</style>

File diff suppressed because it is too large
+ 311 - 0
pages/users/user_integral/greed.vue


+ 288 - 0
pages/users/user_integral/itemuser.vue

@@ -0,0 +1,288 @@
+<template>
+	<view :style="colorStyle">
+		<view style="padding-top: 30rpx;">
+			<view class="money">
+				建议售价:{{greeMoney}}
+			</view>
+		</view>
+		<view class="promoter-list">
+			<view class='list' v-if="recordList.length">
+				<block v-for="(item,index) in recordList" :key="index">
+					<view class='item acea-row row-between-wrapper' :class="index == 0 ? 'radius15' : ''">
+						<view class="picTxt acea-row row-between-wrapper">
+							<view class='pictrue'>
+								<image :src='item.avatar'></image>
+							</view>
+							<view class='text'>
+								<view class='name line1'>{{item.nickname}}</view>
+								<view>手机号: {{item.phone}}</view>
+							</view>
+						</view>
+						<view class="right">
+							<view><text class="num">{{item.green_integral|| 0}}</text></view>
+						</view>
+					</view>
+				</block>
+			</view>
+			<view v-if="recordList.length == 0">
+				<emptyPage title="暂无数据~"></emptyPage>
+			</view>
+		</view>
+		<home v-if="navigation"></home>
+		<!-- #ifdef MP -->
+		<authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
+		<!-- #endif -->
+	</view>
+</template>
+
+<script>
+	import {
+		getGreedUserList
+	} from '@/api/user.js';
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		getIndexData
+	} from '@/api/api.js';
+
+	import {
+		mapGetters
+	} from "vuex";
+	import emptyPage from '@/components/emptyPage.vue'
+	import home from '@/components/home';
+	import colors from '@/mixins/color.js';
+	export default {
+		components: {
+			home,
+			emptyPage
+		},
+		mixins: [colors],
+		data() {
+			return {
+				page: 1,
+				limit: 20,
+				recordList: [],
+				isAuto: false, //没有授权的不会自动授权
+				isShowAuth: false, //是否隐藏授权
+				count: 0,
+				status: false,
+				greeMoney: '',
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		onLoad() {
+			getIndexData().then((res) => {
+				this.greeMoney = res.data.green_integral_price
+			});
+			if (this.isLogin) {
+				this.userSpreadNewList();
+			} else {
+				//#ifndef MP
+				toLogin();
+				//#endif
+				//#ifdef MP
+				this.isShowAuth = true;
+				//#endif
+			}
+		},
+		onShow: function() {
+			if (this.is_show) this.userSpreadNewList();
+		},
+		onHide: function() {
+			this.is_show = true;
+		},
+		methods: {
+			onLoadFun(e) {
+				this.userSpreadNewList();
+				this.isShowAuth = false;
+			},
+			// 授权关闭
+			authColse: function(e) {
+				this.isShowAuth = e
+			},
+			userSpreadNewList: function() {
+				let that = this;
+				if (that.status == true) return;
+				let page = that.page;
+				let limit = that.limit;
+				let recordList = that.recordList;
+				let recordListNew = [];
+				getGreedUserList({
+					page: page,
+					limit: limit,
+				}).then(res => {
+					let len = res.data.list.length;
+					let recordListData = res.data.list;
+					recordListNew = recordList.concat(recordListData);
+					that.status = limit > len;
+					that.page = page + 1;
+					that.$set(that, 'recordList', recordListNew);
+					that.count = res.data.count;
+				});
+			}
+		},
+		onReachBottom: function() {
+			this.userSpreadNewList();
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.money {
+		padding: 30rpx;
+		margin: 0 30rpx;
+		background-color: #FFF;
+		border-radius: 10rpx;
+	}
+
+	.promoter-list .nav {
+		background-color: #fff;
+		height: 86rpx;
+		line-height: 86rpx;
+		font-size: 28rpx;
+		color: #282828;
+		border-bottom: 1rpx solid #eee;
+	}
+
+	.promoter-list .nav .item.on {
+		border-bottom: 5rpx solid var(--view-theme);
+		color: var(--view-theme);
+	}
+
+	.promoter-list .search {
+		width: 100%;
+		background-color: var(--view-theme);
+		border-bottom: 1px solid #f2f2f2;
+		height: 86rpx;
+		padding: 0 30rpx;
+		box-sizing: border-box;
+	}
+
+	.promoter-list .search .input {
+		width: 100%;
+		height: 60rpx;
+		border-radius: 50rpx;
+		background-color: #f5f5f5;
+		position: relative;
+	}
+
+	.promoter-list .search .input input {
+		height: 100%;
+		font-size: 26rpx;
+		width: 100%;
+		padding-left: 30rpx;
+	}
+
+	.promoter-list .search .input .placeholder {
+		color: #bbb;
+	}
+
+	.promoter-list .search .input .iconfont {
+		position: absolute;
+		right: 28rpx;
+		color: #999;
+		font-size: 28rpx;
+		top: 50%;
+		transform: translateY(-50%);
+	}
+
+	.promoter-list .search .iconfont {
+		font-size: 45rpx;
+		color: #515151;
+		background-color: var(--view-theme);
+		width: 110rpx;
+		height: 60rpx;
+		line-height: 60rpx;
+	}
+
+	.promoter-list .list {
+		margin-top: 12rpx;
+	}
+
+	.promoter-list .list .sortNav {
+		background-color: #fff;
+		height: 76rpx;
+		border-bottom: 1rpx solid #eee;
+		color: #333;
+		font-size: 28rpx;
+	}
+
+	.promoter-list .list .sortNav .sortItem {
+		text-align: center;
+		flex: 1;
+	}
+
+	.promoter-list .list .sortNav .sortItem image {
+		width: 24rpx;
+		height: 24rpx;
+		margin-left: 6rpx;
+		vertical-align: -3rpx;
+	}
+
+	.promoter-list .list .item {
+		background-color: #fff;
+		border-bottom: 1rpx solid #eee;
+		height: 152rpx;
+		padding: 0 30rpx 0 20rpx;
+		font-size: 24rpx;
+		color: #666;
+		margin: 0 30rpx;
+	}
+
+	.promoter-list .list .item .picTxt {
+		width: 440rpx;
+	}
+
+	.promoter-list .list .item .picTxt .pictrue {
+		width: 106rpx;
+		height: 106rpx;
+		border-radius: 50%;
+	}
+
+	.promoter-list .list .item .picTxt .pictrue image {
+		width: 100%;
+		height: 100%;
+		border-radius: 50%;
+		border: 3rpx solid #fff;
+		box-shadow: 0 0 10rpx #aaa;
+		box-sizing: border-box;
+	}
+
+	.promoter-list .list .item .picTxt .text {
+		width: 304rpx;
+		font-size: 24rpx;
+		color: #666;
+	}
+
+	.promoter-list .list .item .picTxt .text .name {
+		font-size: 28rpx;
+		color: #333;
+		margin-bottom: 13rpx;
+	}
+
+	.promoter-list .list .item .right {
+		width: 190rpx;
+		text-align: right;
+		font-size: 22rpx;
+		color: #333;
+	}
+
+	.promoter-list .list .item .right .num {
+		margin-right: 7rpx;
+	}
+
+	.top_num {
+		padding: 30rpx;
+		font-size: 26rpx;
+		color: #666;
+	}
+
+	.main_color {
+		color: #E93323;
+	}
+
+	.radius15 {
+		border-radius: 14rpx 14rpx 0 0;
+	}
+</style>

+ 9 - 0
pages/users/user_spread_user/index.vue

@@ -46,6 +46,14 @@
 				</view>
 			</view>
 			<view class="statistics acea-row">
+				<view class="item mb acea-row row-column row-center-wrapper" @click="jumbPath(12)">
+					<view class="img">
+						<image :src="imgHost+'/statics/images/spread_yj.png'" class="image"></image>
+					</view>
+					<view class="item-r">
+						<view class="text">佣金转账</view>
+					</view>
+				</view>
 				<view class="item mb acea-row row-column row-center-wrapper" @click="jumbPath(8)">
 					<view class="img">
 						<image :src="imgHost+'/statics/images/spread_dd.png'" class="image"></image>
@@ -262,6 +270,7 @@
 					'/pages/users/promoter-list/index',
 					'/pages/users/user_distribution_level/index',
 					'/pages/users/user_distribution_info/index',
+					'/pages/users/user_cash/target',
 				]
 
 				uni.navigateTo({

Some files were not shown because too many files changed in this diff