lyy@qq.com 11 miesięcy temu
rodzic
commit
22d09bf012

+ 1 - 1
components/my-goods/my-goods.vue

@@ -3,7 +3,7 @@
 		<view class="goods">
 			<view class="goods-img">
 				<image v-if="item.imgUrl" mode="aspectFit" class="wh-full" :src="item.imgUrl"></image>
-				<view else class="pic"></view>
+				<view v-else class="pic"></view>
 			</view>
 			<view class="right-info">
 				<view class="good-title">{{item.skuName}}</view>

+ 1 - 1
components/specPopup.vue

@@ -118,7 +118,7 @@
 
 				if (this.isSelected) {
 					// 如果所有规格都至少有一个选项被选中
-					const res = await this.$request('get', `/item/sku/${this.intSkuId}`)
+					const res = await this.$request('get', `/item/sku/queryItem/${this.intSkuId}`)
 					if (res) {
 						this.caMsg = res.data
 						this.vModelValue = 1

+ 2 - 2
main.js

@@ -109,9 +109,9 @@ Vue.prototype.autoLogin = async () => { // 小程序自动登录
 	return new Promise(resolve => {
 		uni.login({
 			success: async (res) => {
-				const result = await Vue.prototype.$request('post', '/miniLogin', {
+				const result = await Vue.prototype.$request('post', '/auth/miniLogin', {
 					code: res.code,
-					appid: '000000'
+					tenantId: '000000'
 					//appid: Vue.prototype.appId
 				})
 				if (result) {

+ 59 - 74
pages.json

@@ -1,18 +1,16 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-			"path" : "pages/classify/classify",
-			"style" : 
-			{
-				"navigationBarTitleText" : "首页",
-				"enablePullDownRefresh" : false
+			"path": "pages/classify/classify",
+			"style": {
+				"navigationBarTitleText": "首页",
+				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path" : "pages/login/login",
-			"style" : 
-			{
-				"navigationBarTitleText" : "登录"
+			"path": "pages/login/login",
+			"style": {
+				"navigationBarTitleText": "登录"
 			}
 		},
 		{
@@ -22,101 +20,89 @@
 			}
 		},
 		{
-			"path" : "pages/user/user",
-			"style" : 
-			{
-				"navigationBarTitleText" : "我的",
-				"enablePullDownRefresh" : false
+			"path": "pages/user/user",
+			"style": {
+				"navigationBarTitleText": "我的",
+				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path" : "pages/user/myInfo",
-			"style" : 
-			{
-				"navigationBarTitleText" : "个人中心",
-				"enablePullDownRefresh" : false
+			"path": "pages/user/myInfo",
+			"style": {
+				"navigationBarTitleText": "个人中心",
+				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path" : "pages/order/orderPaid/orderPaid",
-			"style" : 
-			{
-				"navigationBarTitleText" : "订单详情"
+			"path": "pages/order/orderPaid/orderPaid",
+			"style": {
+				"navigationBarTitleText": "订单详情"
 			}
 		},
 		{
-			"path" : "pages/order/submitOrder/submitOrder",
-			"style" : 
-			{
-				"navigationBarTitleText" : "提交订单",
-				"enablePullDownRefresh" : false
+			"path": "pages/order/submitOrder/submitOrder",
+			"style": {
+				"navigationBarTitleText": "提交订单",
+				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path" : "pages/login/qrCode",
-			"style" : 
-			{
-				"navigationBarTitleText" : "登录"
+			"path": "pages/login/qrCode",
+			"style": {
+				"navigationBarTitleText": "登录"
 			}
 		},
-		
+
 		{
-			"path" : "pages/diningList/diningList",
-			"style" : 
-			{
-				"navigationBarTitleText" : "餐车列表"
+			"path": "pages/diningList/diningList",
+			"style": {
+				"navigationBarTitleText": "餐车列表"
 			}
 		},
-			
+
 		{
-			"path" : "pages/diningCar/diningCar",
-			"style" : 
-			{
-				"navigationBarTitleText" : "餐车信息",
-				"enablePullDownRefresh" : false
+			"path": "pages/diningCar/diningCar",
+			"style": {
+				"navigationBarTitleText": "餐车信息",
+				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path" : "pages/bindPhone/bindPhone",
-			"style" : 
-			{
-				"navigationBarTitleText" : "登录",
-				"enablePullDownRefresh" : false
+			"path": "pages/bindPhone/bindPhone",
+			"style": {
+				"navigationBarTitleText": "登录",
+				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path" : "pages/order/myOrder/myOrder",
-			"style" : 
-			{
-				"navigationBarTitleText" : "我的订单",
-				"enablePullDownRefresh" : false
+			"path": "pages/order/myOrder/myOrder",
+			"style": {
+				"navigationBarTitleText": "我的订单",
+				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path" : "pages/order/paySuccess/paySuccess",
-			"style" : 
-			{
-				"navigationBarTitleText" : "支付成功",
-				"enablePullDownRefresh" : false
+			"path": "pages/order/paySuccess/paySuccess",
+			"style": {
+				"navigationBarTitleText": "支付成功",
+				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path" : "pages/order/orderDetail/orderDetail",
-			"style" : 
-			{
-				"navigationBarTitleText" : "订单详情",
-				"enablePullDownRefresh" : false
+			"path": "pages/order/orderDetail/orderDetail",
+			"style": {
+				"navigationBarTitleText": "订单详情",
+				"enablePullDownRefresh": false
 			}
 		},
 		{
-			"path" : "pages/goodDetail/goodDetail",
-			"style" : 
-			{
-				"navigationBarTitleText" : "商品详情",
-				"enablePullDownRefresh" : false
+			"path": "pages/goodDetail/goodDetail",
+			"style": {
+				"navigationBarTitleText": "商品详情",
+				"enablePullDownRefresh": false
 			}
 		},
-		
+
 		{
 			"path": "pages/index/home",
 			"style": {
@@ -124,10 +110,9 @@
 			}
 		},
 		{
-			"path" : "pages/order/orderDetails/orderDetails",
-			"style" : 
-			{
-				"navigationBarTitleText" : ""
+			"path": "pages/order/orderDetails/orderDetails",
+			"style": {
+				"navigationBarTitleText": ""
 			}
 		}
 	],
@@ -167,4 +152,4 @@
 		"backgroundColor": "#EEEEEE"
 	},
 	"uniIdRouter": {}
-}
+}

+ 10 - 1
pages/classify/classify.vue

@@ -185,7 +185,7 @@
 			},
 			onOrder() {
 				uni.navigateTo({
-					url: `/pages/order/myOrder/myOrder`
+					url: `/pages/order/myOrder/myOrder?type=0`
 				})
 			},
 			onMyInfo() {
@@ -206,12 +206,21 @@
 				const result = await this.$request('post', '/sale/diningCarProduct/queryDiningCarProduct', queryParmas,
 					true)
 				if (result) {
+					// this.goods = result.rows
 					const queIds = new Set(result.rows.map(item => item.spuId));
 					const spuIds = Array.from(queIds).join(',');
 					const res = await this.$request('get', `/item/spu/queryByIds?spuIds=${spuIds}`)
 					const data = res.data
 					this.goods = data.filter(item => item.status !== 1)
 				}
+				const params = {
+					storeId: this.cList.id
+				}
+				const res = await this.$request('get', '/order/tradeOrder/queryTradeOrder', params)
+				if (res) {
+					console.log('result', res.rows)
+					this.txts = res.rows.length
+				}
 			},
 			async carListMeg() {
 				const res = await this.$request('get', `/front/shoppingCart/list`, {

+ 1 - 1
pages/goodDetail/goodDetail.vue

@@ -217,7 +217,7 @@
 			//获取详情列表
 			async fatchDate() {
 				const id = this.dataDel.spuId
-				const res = await this.$request('get', `/item/spu/${id}`)
+				const res = await this.$request('get', `/item/spu/queryProduct/${id}`)
 				if (res) {
 					this.goods = res.data
 				}

+ 31 - 23
pages/order/myOrder/myOrder.vue

@@ -24,35 +24,41 @@
 						v-for="(item, index) in tabItem.orderList" :key="index">
 						<!-- 订单项 -->
 						<view class="order-item padding bg-main border-radius">
-							<view @click="todetail(item.order)">
+							<view @click="todetail(item)">
 								<view class="dflex-b padding-bottom-sm">
-									<view class="fs fwb dflex">
-										<u-tag text="打包" size="mini" bgColor="#FFF4E4" color="#F5821F" shape="circle"
+									<view class="fs-xs fwb dflex">
+										<u-tag :text="item.pickupInfo.pickupType ? '堂食' : '打包'" size="mini"
+											bgColor="#FFF4E4" color="#F5821F" shape="circle"
 											borderColor="#FFF4E4"></u-tag>
-										订单编号:M000003332
+										订单编号:{{ item.orderId }}
 									</view>
-									<text class="fs active">等待付款</text>
+									<text class="fs-xs active">
+										<text v-if="item.status == 'TRADE_NO_CREATE_PAY'">待付款</text>
+										<text v-else>已完成</text>
+									</text>
 								</view>
 								<!-- 订单商品明细 -->
 								<view class="goods-area dflex-b">
 									<view class="pic-list dflex">
-										<view class="pic"></view>
-										<view class="pic"></view>
-										<view class="pic"></view>
+										<view v-for="(i, gindex) in item.orderItemVoList" :key="gindex"
+											class="margin-right-sm">
+											<image v-if="i.picUrl" mode="aspectFit" class="wh-full" :src="i.picUrl">
+											</image>
+											<view v-else class="pic"></view>
+										</view>
 									</view>
 									<view class="next-detail">
-										<text>共3件</text>
+										<text v-if="item.orderItemVoList">共{{item.orderItemVoList.length}}件</text>
 										<u-icon name="arrow-right" size="20"></u-icon>
 									</view>
-
 								</view>
 
 								<!-- 实付款 -->
 								<view class="dflex-e padding-top-sm">
-									<text class="fs-xs margin-right-xs">共3件</text>
-									<text class="fs-xs margin-right-xs">共6份商品</text>
+									<text class="fs-xs margin-right-xs"
+										v-if="item.orderItemVoList">共{{item.orderItemVoList.length}}份商品</text>
 									<text class="fs-xs margin-right-xs">实付</text>
-									<text class="price ft-main">{{ item.order.order_actural_paid}}</text>
+									<text class="price ft-main">{{ item.payAmount}}</text>
 								</view>
 							</view>
 
@@ -65,8 +71,10 @@
 								<view class="dflex-e">
 									<view class="dflex">
 										<button class="action-btn border-radius-big bg-main">取消订单</button>
-										<button class="action-btn border-radius-big bg-main" @click="todetail">订单详情</button>
-										<button class="action-btn border-radius-big bg-main main-btn">去支付</button>
+										<button class="action-btn border-radius-big bg-main"
+											@click="todetail(item)">订单详情</button>
+										<button class="action-btn border-radius-big bg-main main-btn"
+											@click="todetail(item)">去支付</button>
 									</view>
 								</view>
 							</view>
@@ -167,15 +175,14 @@
 				const params = {
 					storeId: e.id
 				}
-				const result = await this.$request('get', '/order/retailOrder/list', params)
+				const result = await this.$request('get', '/order/tradeOrder/queryTradeOrder', params)
 				if (result) {
+
 					console.log('result', result.rows)
-					this.navList.orderList = result.rows
-					console.log('orderList', this.navList.orderList)
-					this.navList.orderList.order_detail = result.rows.itemList
-					console.log('order_detail', result.rows.itemList)
-					this.navList.orderList.order = result.rows.pickupInfo
-					console.log('order', result.rows.pickupInfo)
+					this.navList[0].orderList = result.rows
+					console.log('orderList', this.navList[0].orderList)
+					this.navList[1].orderList = result.rows.filter(item => item.status == 'TRADE_NO_CREATE_PAY');
+
 				}
 			},
 			loadData() {},
@@ -190,11 +197,12 @@
 
 			// 点击跳转详情页面
 			todetail(order) {
+				console.log('order', order)
 				// uni.navigateTo({
 				// 	url: `/pages/user/order/order-detail?order_id=${order.order_id}`
 				// });
 				uni.navigateTo({
-					url: `/pages/order/orderPaid/orderPaid`
+					url: `/pages/order/orderPaid/orderPaid?id=${order.orderId}`
 				});
 			},
 			// 立即支付

+ 111 - 6
pages/order/orderPaid/orderPaid.vue

@@ -98,7 +98,7 @@
 		<view class="bar-space"></view>
 		<view class="cart-bottom padding-sm dflex-b">
 			<view class="go-cart dflex-c">取消订单</view>
-			<view class="go-buy dflex-c background-gradient">去支付</view>
+			<view class="go-buy dflex-c background-gradient" @click="toPay()">去支付</view>
 		</view>
 	</view>
 </template>
@@ -115,21 +115,126 @@
 			this.fatchDate(e)
 		},
 		onUnload() {
-			uni.redirectTo({
-				url: `/pages/classify/classify` // 指定页面的路径
-			});
-			return true;
+			// uni.redirectTo({
+			// 	url: `/pages/classify/classify` // 指定页面的路径
+			// });
+			// return true;
 		},
 		methods: {
 			async fatchDate(e) {
 				console.log('e', e)
-				const result = await this.$request('get', `/order/retailOrder/${e.id}`,
+				const result = await this.$request('get', `/order/tradeOrder/queryTradeOrder/${e.id}`,
 					true)
 				if (result) {
 					console.log('result', result.data)
 					this.goods = result.data
 					this.lists = this.goods.itemList.length
+					this.goods.itemList.forEach(item => {
+						item.imgUrl = item.picUrl
+					})
+					console.log('this.goods', this.goods)
+					console.log('this.goods.itemList', this.goods.itemList)
 				}
+			},
+			uuid() {
+				return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+					var r = Math.random() * 16 | 0,
+						v = c == 'x' ? r : (r & 0x3 | 0x8);
+					return v.toString(16);
+				});
+			},
+			toPay() {
+				const params = {
+					orderId: this.goods.orderId,
+					amount: this.goods.payment,
+				}
+				this.$request('post', `/order/orderPay/addOrderPay`, params, true).then(res => {
+					this._toPay()
+				})
+
+			},
+			async _toPay() {
+				console.log('this.uuid()', this.uuid())
+				const openId = uni.getStorageSync('openId');
+				const token = uni.getStorageSync('token');
+				if (!token) {
+					await this.autoLogin()
+				}
+				const that = this;
+				uni.request({
+					url: 'http://36.137.224.81:8030/weChatPay/payment/miniPay',
+					header: {
+						// "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", //
+						"Content-Type": "application/json;charset=UTF-8", //
+						'Authorization': 'Bearer ' + token,
+					},
+					method: 'post',
+					data: {
+						tenantId: '000000',
+						outTradeNo: this.uuid(),
+						openId: openId,
+						total: Math.round(this.goods.payment * 10), //以分为单位
+						profitSharing: false // 是否分销
+					},
+
+					success: res => {
+						console.log('预支付成功')
+						that.data = res.data;
+						wx.requestPayment({
+							"timeStamp": res.data.timeStamp,
+							"nonceStr": res.data.nonceStr,
+							"package": res.data.packageValue,
+							"signType": "RSA",
+							"paySign": res.data.paySign,
+							"success": function(res) {
+								console.log('调用支付接口成功', res)
+							},
+							"fail": function(res) {
+								console.log('调用支付接口fail', res)
+							},
+							"complete": function(res) {
+								console.log('调用支付接口完成', res)
+							}
+						})
+					},
+					fail: err => {
+						uni.hideLoading()
+					}
+				})
+				// const params = {
+				// 	tenantId: '000000',
+				// 	outTradeNo: this.uuid(),
+				// 	openId: openId,
+				// 	total: Math.round(this.goods.payment * 10),	//以分为单位
+				// 	profitSharing: false // 是否分销
+				// }
+				// console.log('params', params)
+				// this.$request('post', `/weChatPay/payment/miniPay`, params, true).then(res => {
+				// 	// 请求成功
+				// 	console.log('response', res)
+				// 	console.log('预支付成功')
+				// 	that.data = res.data;
+				// 	wx.requestPayment({
+				// 		"timeStamp": res.data.timeStamp,
+				// 		"nonceStr": res.data.nonceStr,
+				// 		"package": res.data.packageValue,
+				// 		"signType": "RSA",
+				// 		"paySign": res.data.paySign,
+				// 		"success": function(res) {
+				// 			console.log('调用支付接口成功', res)
+				// 		},
+				// 		"fail": function(res) {
+				// 			console.log('调用支付接口fail', res)
+				// 		},
+				// 		"complete": function(res) {
+				// 			console.log('调用支付接口完成', res)
+				// 		}
+				// 	})
+				// }).catch(error => {
+				// 	// 请求失败
+				// 	uni.hideLoading()
+				// 	console.error('请求失败:', error);
+				// })
 			}
 		}
 	}

+ 70 - 38
pages/order/submitOrder/submitOrder.vue

@@ -74,7 +74,7 @@
 			</view> -->
 		</view>
 		<view class="gap"></view>
-		<my-gap :height="130" />
+		<!-- <my-gap :height="130" /> -->
 		<view class="submit-bar padding-sm dflex-b">
 			<view class="submit-btn dflex-c background-gradient" @click="toBuy">立即下单</view>
 		</view>
@@ -82,6 +82,9 @@
 </template>
 
 <script>
+	import {
+		multiply
+	} from '@/utils/accuracy.js'
 	export default {
 		data() {
 			return {
@@ -93,11 +96,11 @@
 				vals: null,
 				list: [{
 						text: "店内用餐",
-						value: 'A'
+						value: 0
 					},
 					{
 						text: "打包带走",
-						value: 'B'
+						value: 1
 					}
 				]
 			}
@@ -138,7 +141,7 @@
 					})
 					return
 				}
-				if (this.val == '' || this.val == null) {
+				if (this.val == null && this.val == undefined && this.val == '') {
 					uni.showToast({
 						title: '请选择取餐方式',
 						icon: 'error',
@@ -150,55 +153,84 @@
 				const userName = uni.getStorageSync('userName');
 				const itemListArray = this.data.carlist.map(item => ({
 					skuId: item.skuId,
-					isGift: false, // 假设所有商品都不是礼物
-					basePrice: item.basePrice,
-					price: item.price,
+					gift: 1, // 假设所有商品都不是礼物
+					basePrice: Number(item.basePrice),
+					price: Number(item.price),
 					quantity: item.quantity,
 					sellerType: 'C', // 假设所有商品卖家类型都是 'C'
-					isFenxiao: false // 假设所有商品都不是分销商品
+					spuId: item.spuId,
+					skuName: item.skuName,
+					title: item.skuTitle,
+					picUrl: item.imgUrl,
+					skuProperties: item.skuProperties,
+					totalFee: multiply(Number(item.price), item.quantity),
+					adjustFee: 0
 				}))
 
 				const params = {
-					orderType: 'waimai,cod',
-					isCod: true,
-					shippingType: 'SELF_PICKUP',
+					orderState: 1,
+					orderType: 1,
+					serviceType: 1,
+					payAmount: Number(this.data.total),
+					totalAmount: Number(this.data.total),
+					discountAmount: 0,
+					adjustAmount: 0,
+					postAmount: 0,
+					receivedAmount: Number(this.data.total),
+					commissionAmount: 0,
+					payOnDeliveryAmount: 0,
+					payOnDelivery: 1,
+					payType: 1,
+					payChannel: 1,
+					invoice: 1,
 					storeId: this.cList.id,
 					storeName: this.cList.name,
-					arriveCutTime: this.value,
 					sellerNick: this.cList.name,
 					buyerNick: userName,
 					customerId: userId,
-					itemList: itemListArray,
-					pickupInfo: {
+					orderItemList: itemListArray,
+					shippingType: 4,
+					orderPickup: {
 						pickupType: this.val,
-						isVerify: false
+						verify: 2
 					}
 				}
 				console.log('params', params);
-				uni.navigateTo({
-					url: `/pages/order/orderPaid/orderPaid`
-				})
-				// this.$request('post', `/order/retailOrder`, params, true).then(response => {
-				// 	// 请求成功
-				// 	console.log('response', response)
-				// 	if (response.code == 200) {
-				// 		const ids = this.data.carlist.map(car => car.id);
-				// 		this.$request('delete', `/front/shoppingCart/${ids}`)
-				// 		console.log('response.data', response.data)
-				// 		uni.navigateTo({
-				// 			url: `/pages/order/orderPaid/orderPaid?id=${response.data}`
-				// 		})
-				// 	} else if (response.code == 500) {
-				// 		uni.showToast({
-				// 			title: response.msg,
-				// 			icon: 'error',
-				// 			duration: 2000
-				// 		});
-				// 	}
-				// }).catch(error => {
-				// 	// 请求失败
-				// 	console.error('请求失败:', error);
+				// uni.navigateTo({
+				// 	url: `/pages/order/orderPaid/orderPaid`
 				// })
+				this.$request('post', `/order/tradeOrder/addTradeOrder`, params, true).then(response => {
+					// 请求成功
+					console.log('response', response)
+					if (response.code == 200) {
+						const ids = this.data.carlist.map(car => car.id);
+						this.$request('delete', `/front/shoppingCart/${ids}`)
+						console.log('response.data', response.data)
+						uni.showToast({
+							title: '已下单,因目前是演示阶段,暂时不能付款',
+							icon: 'success',
+							duration: 2000,
+							complete: () => {
+								// 页面跳转放在complete回调中
+								uni.navigateTo({
+									url: `/pages/order/myOrder/myOrder?type=0`
+								})
+							}
+						})
+						// uni.navigateTo({
+						// 	url: `/pages/order/orderPaid/orderPaid?id=${response.data}`
+						// })
+					} else if (response.code == 500) {
+						uni.showToast({
+							title: response.msg,
+							icon: 'error',
+							duration: 2000
+						});
+					}
+				}).catch(error => {
+					// 请求失败
+					console.error('请求失败:', error);
+				})
 			}
 		}
 	}

+ 25 - 4
pages/user/myInfo.vue

@@ -3,12 +3,12 @@
 		<view style="margin: 20px; background-color: #fff;">
 			<!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
 			<u--form labelPosition="left" :model="userInfo" :rules="rules" ref="uForm">
-				<u-form-item label="姓名" prop="userInfo.name">
-					<u--input v-model="userInfo.name" border="none"></u--input>
+				<u-form-item label="姓名" prop="userInfo.nickName">
+					<u--input v-model="userInfo.nickName" border="none"></u--input>
 				</u-form-item>
-				<u-form-item label="头像" prop="userInfo.avg">
+				<u-form-item label="头像" prop="userInfo.avatarUrl">
 					<view slot="right" class="flex-row" @click="onInfo">
-						<u-avatar :src="getFilePath(userInfo.avg ? userInfo.avg : null)" size="50"
+						<u-avatar :src="userInfo.avatarUrl ? userInfo.avatarUrl : null" size="50"
 							@click="uploadAvator"></u-avatar>
 						<view class="flex-grow-1">
 							<u-icon name="arrow-right" color="#96989e"></u-icon>
@@ -67,7 +67,28 @@
 
 			}
 		},
+		onLoad() {
+			this.fatchDate()
+		},
 		methods: {
+			fatchDate() {
+				wx.getUserInfo({
+				    success: (res)=>{
+				        console.log(res)
+						this.userInfo = res.userInfo
+						console.log(res.userInfo)
+				    }
+				})
+				// const result = await this.$request('post',
+				// 	'/auth/getUserInfo', true)
+				
+				// wx.getUserProfile({
+				// 	desc: '获取用户信息',
+				// 	success: (res) => {
+				// 		console.log('res', res)
+				// 	},
+				// })
+			},
 			uploadAvator() { // 上传头像
 				uni.chooseImage({
 					success: (file) => {

+ 14 - 3
pages/user/user.vue

@@ -5,12 +5,12 @@
 				<view class="page-header-content">
 					<view class="page-header-content-left">
 						<view class="" @click="onInfo">
-							<u-avatar :src="getFilePath(userdata ? userdata.avatarUrl : null)" size="100"></u-avatar>
+							<u-avatar :src="userdata ? userdata.avatarUrl : null" size="100"></u-avatar>
 						</view>
 					</view>
 					<view class="page-header-content-center">
 						<view>
-							<view class="fz16px mt5px">{{userdata && userdata.phone ? userdata.phone : '22222'}}</view>
+							<view class="fz16px mt5px">{{userdata && userdata.nickName ? userdata.nickName : '22222'}}</view>
 						</view>
 					</view>
 				</view>
@@ -85,7 +85,8 @@
 			return {
 				userdata:{
 					avatarUrl:'',
-					phone:''
+					phone:'',
+					nickName:''
 				},
 				cPhone: ''
 			}
@@ -93,6 +94,7 @@
 		onLoad() {
 			const e = uni.getStorageSync('info')
 			this.cPhone = e
+			this.fatchDate()
 		},
 		methods: {
 			openPage(path) {
@@ -100,6 +102,15 @@
 					url: path
 				})
 			},
+			fatchDate() {
+				wx.getUserInfo({
+				    success: (res)=>{
+				        console.log(res)
+						this.userdata = res.userInfo
+						console.log(res.userInfo)
+				    }
+				})
+			},
 			call() {
 				console.log('eeeeeeeeeeeeeeee===============', this.cPhone)
 				if (this.cPhone.customerPhone) {

+ 1 - 1
style/common.scss

@@ -127,7 +127,7 @@ view[class*='border-radius']{ overflow: hidden;}
 /* 外边距 */
 .margin-0{margin: 0;}.margin-xs{margin: 10rpx;}.margin-sm{margin: 20rpx;}.margin{margin: 30rpx;}.margin-lg{margin: 40rpx;}.margin-xl{margin: 50rpx;}.margin-big{margin: 100rpx;}
 .margin-top-xs{margin-top: 10rpx;}.margin-top-sm{margin-top: 20rpx;}.margin-top{margin-top: 30rpx;}.margin-top-lg{margin-top: 40rpx;}.margin-top-xl{margin-top: 50rpx;}.margin-top-big{margin-top: 100rpx;}
-.margin-right-xs{margin-right: 10rpx;}.margin-right-sm{margin-right: 20rpx;}.margin-right{margin-right: 30rpx;}.margin-right-lg{margin-right: 40rpx;}.margin-right-xl{margin-right: 50rpx;}
+.margin-right-xs{margin-right: 10rpx;}.margin-right-sm{margin-right: 16rpx;}.margin-right{margin-right: 30rpx;}.margin-right-lg{margin-right: 40rpx;}.margin-right-xl{margin-right: 50rpx;}
 .margin-bottom-xs{margin-bottom: 10rpx;}.margin-bottom-sm{margin-bottom: 20rpx;}.margin-bottom{margin-bottom: 30rpx;}.margin-bottom-lg{margin-bottom: 40rpx;}.margin-bottom-xl{margin-bottom: 50rpx;} .margin-bottom-big {margin-bottom: 100rpx;}
 .margin-left-xs{margin-left: 10rpx;}.margin-left-sm{margin-left: 20rpx;}.margin-left{margin-left: 30rpx;}.margin-left-lg{margin-left: 40rpx;}.margin-left-xl{margin-left: 50rpx;}