Răsfoiți Sursa

排名,获取礼物

hmp 4 ani în urmă
părinte
comite
6c4351c4ec

+ 26 - 1
common/http/http.api.js

@@ -20,6 +20,8 @@ let userUrl = {
 	loginUrl: '/cyzh-loginUser/loginuser/login',
 	detailUrl: '/cyzh-loginUser/loginuser/detail',
 	submitUrl: '/cyzh-loginUser/loginuser/submit',
+	userAddress:'/cyzh-userAddress/useraddress/list',
+	userAddressSubmit:'/cyzh-userAddress/useraddress/submit'
 }
 
 let pointsUrl = {
@@ -29,6 +31,16 @@ let pointsUrl = {
 let boostUrl = {
 	listUrl: '/cyzh-helpRecord/helprecord/list2'
 }
+
+let productionUrl={
+	list:'cyzh-production/production/list'
+}
+
+let goodsUrl={
+	getMineGoods:'cyzh_userGoods/usergoods/list',
+	donate:'cyzh_userGoods/usergoods/donate'
+}
+
 // 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
 // https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
 const install = (Vue, vm) => {
@@ -48,6 +60,8 @@ const install = (Vue, vm) => {
 		login:(params = {}) => vm.$u.post(userUrl.loginUrl, params),
 		detail:(params = {}) => vm.$u.get(userUrl.detailUrl, params),
 		submit:(params = {}) => vm.$u.post(userUrl.submitUrl, params),
+		userAddress:(params = {}) => vm.$u.get(userUrl.userAddress, params),
+		userAddressSubmit:(params = {}) => vm.$u.post(userUrl.userAddressSubmit, params),
 	}
 	
 	let points = {
@@ -57,8 +71,19 @@ const install = (Vue, vm) => {
 	let boost = {
 		list:(params = {}) => vm.$u.get(boostUrl.listUrl, params),
 	}
+	
+	let production = {
+		list:(params = {}) => vm.$u.get(productionUrl.list, params),
+	}
+	
+	let goods = {
+		getMineGoods:(params = {}) => vm.$u.get(goodsUrl.getMineGoods, params),
+		donate:(params = {}) => vm.$u.post(goodsUrl.donate, params),
+	}
+	
+	
 	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
-	vm.$u.api = {wxInfo,uploadFile, activity, user, points, boost};
+	vm.$u.api = {wxInfo,uploadFile, activity, user, points, boost,production,goods};
 }
 
 export default {

+ 27 - 0
common/utils/dialog.js

@@ -0,0 +1,27 @@
+let dialog = {};
+
+/**
+ * 封装模态框
+ */
+dialog.showModal=(content,isShowCancel=true,title='提示',)=>{
+    return new Promise((resolve,reject)=>{
+        uni.showModal({
+			title: title,
+			content: content,
+			showCancel:isShowCancel,
+			success: (res)=>{
+				if (res.confirm) {
+					resolve(res)
+				} 
+			}
+		});
+	})
+}
+dialog.showLoading=(title='加载中...')=>{
+	uni.showLoading({
+		title
+	})
+}
+
+
+export default dialog

+ 2 - 2
common/utils/global.js

@@ -1,6 +1,6 @@
 let global = {
-	baseUrl: 'https://vote.guosen-fumao.cn/ldt/api'
-	// baseUrl: 'http://192.168.1.168:9612'
+	// baseUrl: 'https://vote.guosen-fumao.cn/ldt/api'
+	baseUrl: 'http://192.168.1.168:9612'
 }
 
 export default global

+ 4 - 0
main.js

@@ -10,6 +10,10 @@ Vue.config.productionTip = false
 import mpi from './common/utils/mpi.js'
 Vue.prototype.$mpi = mpi
 
+//封装提示工具
+import dialog from './common/utils/dialog.js'
+Vue.prototype.$dialog = dialog
+
 //全局变量
 import Global from './common/utils/global.js'
 Vue.prototype.$global = Global

+ 5 - 4
pages/activityList/activity/hot.vue

@@ -7,13 +7,13 @@
 			<u-line color="#e8e8e8"></u-line>
 			<view class="padding-sm flex justify-between align-center bg-white" @click="navWithParm">
 				<view class="flex justify-around align-center">
-					<view class="padding-right text-center text-black text-bold" style="width: 60upx;">{{index + 1}}</view>
+					<view class="padding-right text-center text-black text-bold" style="width: 60upx;">{{item.loginWebVO.rank}}</view>
 					<view class="padding-right">
-						<u-avatar :src="item.avatar" size="130"></u-avatar>
+						<u-avatar :src="item.loginWebVO.avatar" size="130"></u-avatar>
 					</view>
 					<view>
-						<view class="text-bold text-black">{{item.name}}</view>
-						<view class="margin-tb-xs">{{item.totalHotValue}} 热力值</view>
+						<view class="text-bold text-black">{{item.loginWebVO.nickName}}</view>
+						<view class="margin-tb-xs">{{item.loginWebVO.totalHotValue}} 热力值</view>
 					</view>
 				</view>
 				<view class="padding-right">
@@ -47,6 +47,7 @@
 		methods: {
 			getRankList(id) {
 				this.$u.api.activity.rankList({activityId: id}).then(res => {
+					console.log(res);
 					this.hotList = res.records;
 				})
 			},

+ 44 - 27
pages/activityList/activity/songRank.vue

@@ -16,15 +16,15 @@
 			<image src="/static/songRank/medal.png" style="width: 32upx;height: 40upx"></image>
 			<view style="font-size: 36upx;font-weight: 800;color: #000000;padding-left: 20upx;">提名歌曲</view>
 		</view>
-		<block v-for="(item, index) in songList" :key="index">
+		<block v-for="(item, index) in rankList" :key="index">
 			<block v-if="index == 0 || index == 1 || index == 2">
 				<view class="margin-sm flex align-center" :class="index == 0 ? 'first' : index == 1 ? 'second' : index == 2 ? 'third' : '' ">
-					<u-image width="200" height="200" :src="item.coverImg"></u-image>
+					<u-image width="200" height="200" :src="item.cover"></u-image>
 					<view class="flex justify-between container" :style="{width: (index == 0 ? '70%': index == 1 ? '69%' : index == 2 ? '68%' : '60%')}">
 						<view class="left"  style="width: 65%;">
-							<view class="name text-cut">{{item.name}}</view>
-							<view class="padding-tb-sm text-sm">{{item.singer}}</view>
-							<view class="hot-value">热力值 {{item.hotVaule}}</view>
+							<view class="name text-cut">{{item.title}}</view>
+							<view class="padding-tb-sm text-sm">{{item.personName}}</view>
+							<view class="hot-value">热力值 {{ +item.hotValue}}</view>
 						</view>
 						<view class="right">
 							<view class="rank" :style="{coloar: (index == 0 ? '#ECDA47': index == 1 ? '#C1D4DA' : index == 2 ? '#C1D4DA' : '')}">
@@ -43,13 +43,13 @@
 			<block v-else>
 				<view class="flex" style="padding: 10upx 30upx 30upx 40upx;">
 					<view class="flex justify-center align-center text-bold text-lg padding-right">{{index + 1}}</view>
-					<image :src="item.coverImg" style="width: 120upx;height: 120upx;margin-right: 20upx;"></image>
+					<image :src="item.cover" style="width: 120upx;height: 120upx;margin-right: 20upx;"></image>
 					<view style="width: 70%;">
 						<view class="flex justify-between">
 							<view class="music" style="width: 75%;">
-								<view class="name text-cut">{{item.name}}</view>
-								<view class="author">{{item.singer}}</view>
-								<view class="hot-vaule">热力值 {{item.hotVaule}}</view>
+								<view class="name text-cut">{{item.title}}</view>
+								<view class="author">{{item.personName}}</view>
+								<view class="hot-vaule">热力值 {{ +item.hotValue}}</view>
 							</view>
 							<view class="flex align-end">
 								<button class="cu-btn round lines-purple sm" style="width: 110upx;">打榜</button>
@@ -67,34 +67,51 @@
 	export default {
 		data() {
 			return {
+				activityId:'1407016573251153922',
+				
 				current: 0,
 				list: [{
 					name: '全部'
-				}, {
-					name: '男歌手榜'
-				}, {
-					name: '女歌手榜'
-				}, {
-					name: '组合榜'
 				}],
 				searValue: '不存在的关系 - XMASwu',
-				songList: [
-					{coverImg: '/static/songRank/fm1.png', name: '巴赫旧约', singer: '沈以诚', hotVaule: '3.5w'},
-					{coverImg: '/static/songRank/fm2.png', name: '1987我不知会遇见你', singer: '孟慧圆/邓见超', hotVaule: '3.5w'},
-					{coverImg: '/static/songRank/fm3.png', name: '孤影', singer: 'C-BLOCK', hotVaule: '3.5w'},
-					{coverImg: '/static/musicCover.png', name: '海底(live)', singer: '凤凰传奇', hotVaule: '3.5w'},
-					{coverImg: '/static/songRank/fm4.png', name: '一次就好', singer: '理迎趣', hotVaule: '3.5w'},
-					{coverImg: '/static/songRank/fm1.png', name: '巴赫旧约', singer: '沈以诚', hotVaule: '3.5w'},
-					{coverImg: '/static/songRank/fm2.png', name: '1987我不知会遇见你', singer: '孟慧圆/邓见超', hotVaule: '3.5w'},
-					{coverImg: '/static/songRank/fm3.png', name: '孤影', singer: 'C-BLOCK', hotVaule: '3.5w'},
-					{coverImg: '/static/musicCover.png', name: '海底(live)', singer: '凤凰传奇', hotVaule: '3.5w'},
-					{coverImg: '/static/songRank/fm4.png', name: '一次就好', singer: '理迎趣', hotVaule: '3.5w'}
-				]
+				rankList:[],
 			}
 		},
+		onLoad() {
+			this.getActivityDetail()
+			this.getRankList()
+		},
 		methods: {
 			change(index) {
 				this.current = index;
+				let name=this.list[index].name.replace("榜",'')
+				if (name=='全部') {
+					name=""
+				}
+				this.getRankList(name)
+			},
+			getActivityDetail(){
+				this.$u.api.activity.detail({id:this.activityId}).then(res=>{
+					let arr=res.classification.split(",")
+					arr.forEach(item=>{
+						let obj={
+							name:item+'榜'
+						}
+						this.list.push(obj)
+					})
+				})
+			},
+			getRankList(name){
+				let params={
+					activityId:this.activityId
+				}
+				if (!this.$u.test.empty(name)) {
+					params.personType=name
+				}
+				this.$u.api.production.list(params).then(res=>{
+					this.rankList=res.records
+					console.log(res.records);
+				})
 			}
 		}
 	}

+ 110 - 97
pages/activityList/mine/myGift.vue

@@ -4,80 +4,43 @@
 			<u-tabs :list="list" active-color="#5c40e8" :is-scroll="false" :current="current" @change="change"></u-tabs>
 		</u-sticky>
 		<view v-if="current == 0">
-			<block v-for="(item, index) in giftList" :key="index">
-				<view class="card">
-					<view class="padding">
-						<view class="flex justify-between align-center padding-bottom-sm">
-							<view class="flex align-center">
-								<view class="cuIcon-goods padding-right-xs text-bold text-black" style="font-size: 40upx;"></view>
-								<view class="title">{{item.title}}</view>
-							</view>
-							<view v-if="item.status == '已完成'">
-								<text class="padding-right-sm text-gray">已完成</text>
-								<text class="cuIcon-delete text-gray" style="font-size: 30upx;"></text>
-							</view>
-							<view v-else>
-								<text class="text-red">{{item.status}}</text>
-							</view>
-						</view>
-						<view class="flex margin-top-xs">
-							<image :src="item.image" style="width: 220upx;height: 220upx;"></image>
-							<view class="padding-left-sm">
-								<view class="name text-cut" style="width: 350upx;">{{item.name}}</view>
-								<view class="specification">
-									<view>{{item.specification}}</view>
+			<block v-if="!$u.test.isEmpty(giftList)">
+				<block v-for="(item, index) in giftList" :key="index">
+					<view class="card" @click="select(item)">
+						<view class="flex">
+							<view :class="item.selected==true ? 'theme-color cuIcon-roundcheckfill':'cuIcon-round'" class="padding-sm" style="font-size: 50upx;"></view>
+							<view class="padding-tb-sm">
+								<view class="flex margin-top-xs">
+									<image :src="item.goods.goodsPic" style="width: 220upx;height: 220upx;border-radius: 10rpx;"></image>
+									<view class="padding-left-sm">
+										<view class="name text-cut" style="width: 350upx;">{{item.goods.goodsName}}</view>
+									</view>
 								</view>
 							</view>
 						</view>
-					</view>
-					<view class="flex justify-end padding" style="margin-top: -120upx;">
-						<view class="count">x{{item.count}}</view>
-					</view>
-				</view>
-			</block>
-		</view>
-		<view v-if="current == 1">
-			<block v-for="(item, index) in giftList" :key="index">
-				<view class="card" @click="select(index)" v-if="item.status == '待领取'">
-					<view class="flex">
-						<view :class="item.selected ? 'theme-color cuIcon-roundcheckfill':'cuIcon-round'" class="padding-sm" style="font-size: 50upx;"></view>
-						<view class="padding-tb-sm">
-							<view class="flex align-center padding-bottom-sm">
-								<view class="cuIcon-goods padding-right-xs text-bold text-black" style="font-size: 40upx;"></view>
-								<view class="title">{{item.title}}</view>
-							</view>
-							<view class="flex margin-top-xs">
-								<image :src="item.image" style="width: 220upx;height: 220upx;"></image>
-								<view class="padding-left-sm">
-									<view class="name text-cut" style="width: 350upx;">{{item.name}}</view>
-									<view class="specification">
-										<view>{{item.specification}}</view>
-									</view>
-								</view>
+						<view class="flex justify-end padding" style="margin-top: -110upx;">
+							<view class="count" style="border: #d9d9d9 1upx solid;" v-if="!item.selected">x{{item.exCount}}</view>
+							<view class="justify-center flex align-center" v-else>
+								<view class="" @click.stop="minus(item)"> <u-icon name="minus-circle-fill" color="#5a3ee8" size="36"></u-icon> </view>
+								<input type="number" class="text-center input" v-model="item.exCount" />
+								<view class="" @click.stop="plus(item)"> <u-icon name="plus-circle-fill" color="#5a3ee8" size="36"></u-icon> </view>
 							</view>
 						</view>
 					</view>
-					<view class="flex justify-end padding" style="margin-top: -110upx;">
-						<view class="count" style="border: #d9d9d9 1upx solid;" v-if="!item.selected">x{{item.count}}</view>
-						<view class="justify-center flex align-center" v-else>
-							<view class="" @click.stop="minus(index)"> <u-icon name="minus-circle-fill" color="#5a3ee8" size="36"></u-icon> </view>
-							<input type="number" class="text-center input" v-model="item.count" />
-							<view class="" @click.stop="plus(index)"> <u-icon name="plus-circle-fill" color="#5a3ee8" size="36"></u-icon> </view>
-						</view>
+				</block>
+				<view style="height: 120upx;"></view>
+				<view  style="z-index: 9;" class="footer-fixed flex align-center justify-between padding-sm bg-white">
+					<view class="flex align-center" @click="selectAll">
+						<view :class="selectAllShow ? 'theme-color cuIcon-roundcheckfill':'cuIcon-round'" class="padding-right-xs" style="font-size: 50upx;"></view>
+						<view class="text-sm padding-right-xs">全选</view>
+					</view>
+					<view>
+						<button class="cu-btn round text-white theme-bg-color" style="width: 180upx;height: 80upx;margin-right: 30upx;" @click="donate">捐赠</button>
+						<button class="cu-btn round text-white theme-bg-color" style="width: 180upx;height: 80upx;" @click="navTap">领取</button>
 					</view>
 				</view>
 			</block>
-			<view style="height: 120upx;"></view>
-			<view class="footer-fixed flex align-center justify-between padding-sm bg-white">
-				<view class="flex align-center" @click="selectAll">
-					<view :class="selectAllShow ? 'theme-color cuIcon-roundcheckfill':'cuIcon-round'" class="padding-right-xs" style="font-size: 50upx;"></view>
-					<view class="text-sm padding-right-xs">全选</view>
-				</view>
-				<view>
-					<button class="cu-btn round text-white theme-bg-color" style="width: 180upx;height: 80upx;margin-right: 30upx;" @click="donate">捐赠</button>
-					<button class="cu-btn round text-white theme-bg-color" style="width: 180upx;height: 80upx;" @click="navTap">领取</button>
-				</view>
-			</view>
+			<u-empty v-else margin-top="300" text="暂无礼物" mode="list"></u-empty>
 		</view>
 		<view v-if="current == 2">
 			<block v-for="(item, index) in giftList" :key="index">
@@ -94,12 +57,9 @@
 							</view>
 						</view>
 						<view class="flex margin-top-xs">
-							<image :src="item.image" style="width: 220upx;height: 220upx;"></image>
+							<image :src="item.image" style="width: 220upx;height: 220upx"></image>
 							<view class="padding-left-sm">
 								<view class="name text-cut" style="width: 350upx;">{{item.name}}</view>
-								<view class="specification">
-									<view>{{item.specification}}</view>
-								</view>
 							</view>
 						</view>
 					</view>
@@ -115,7 +75,7 @@
 				<view style="font-size: 50upx;font-family: PingFang SC;font-weight: 600;color: #ffffff;">感谢你</view>
 				<view class="text-bold text-black" style="padding: 80upx 0;">广发基金会已收到您的捐赠!</view>
 				<view class="padding">
-					<u-button class="custom-style" shape="circle" @click="dialogShow = false">确定</u-button>
+					<u-button class="custom-style" shape="circle" @click="confirm">确定</u-button>
 				</view>
 			</view>
 		</u-popup>
@@ -126,32 +86,41 @@
 	export default {
 		data() {
 			return {
+				userId:"2",
+				successList:[],
+				
 				list: [{
-					name: '全部'
-				}, {
 					name: '待领取'
+				}, {
+					name: '配送中'
 				}, {
 					name: '已完成'
 				}],
 				current: 0,
 				selectAllShow: false,
 				clickShow: false,
-				giftList: [
-					{image: '/static/gift/commodity2.png', title: 'lilbetter化妆品旗舰', name: 'Lilbetter发泥男士定型自然', specification: '发泥+洁面乳 120ml', count: 1, selected: true, status: '已完成'},
-					{image: '/static/gift/commodity1.png', title: '轩城工艺沙发', name: '创意单人懒人沙发香蕉躺椅', specification: '黄色(皮质)', count: 3, selected: false, status: '待领取'},
-					{image: '/static/gift/commodity3.png', title: '懒虫家居生活馆', name: '懒人沙发阳台躺卧飘窗榻榻米', specification: '亚麻经典灰', count: 2, selected: true, status: '已完成'},
-					{image: '/static/gift/commodity4.png', title: '白七自制', name: '白七尼龙帆布单肩斜跨学生', specification: '黑色', count: 1, selected: false, status: '待领取'},
-					
-				],
+				giftList: [],
 				dialogShow: false,
 			}
 		},
+		onLoad() {
+			this.getMineGiftList()
+		},
 		methods: {
+			getMineGiftList(){
+				this.$u.api.goods.getMineGoods({userId:this.userId}).then(res=>{
+					this.giftList=res.records
+					this.giftList.forEach(item=>{
+						item.selected=false
+						item.exCount=item.count
+					})
+				})
+			},
 			change(index) {
 				this.current = index;
 			},
-			select(index) {
-				this.giftList[index].selected = !this.giftList[index].selected;
+			select(item) {
+				item.selected=!item.selected
 				let flag = true;
 				for (let item of this.giftList) {
 					if (!item.selected) {
@@ -159,6 +128,7 @@
 					}
 				}
 				this.selectAllShow = flag;
+				this.$forceUpdate()
 			},
 			selectAll() {
 				this.selectAllShow = !this.selectAllShow;
@@ -171,35 +141,78 @@
 				}
 			},
 			donate() {
-				let count = 0;
-				for (let item of this.giftList) {
-					if (item.status == '待领取' && item.selected) {
-						console.log(item.title);
-					} else {
-						count++
+				let flag=false
+				this.giftList.forEach(item=>{
+					if (item.selected) {
+						flag=true
 					}
-				}
-				if (count == this.giftList.length) {
+				})
+				if (!flag) {
 					uni.showToast({
-						title: "请至少选择一件礼包",
-						icon: "none"
+						title:"请至少选择一个礼物!",
+						icon:"none"
 					})
+					return
 				}
+				let newList=this.getSelectGoods()
+				this.$dialog.showModal("确认捐赠?").then(()=>{
+					this.$u.api.goods.donate(newList).then(res=>{
+						// this.successList=res.records
+						this.dialogShow=true
+					})
+				})
+			},
+			getSelectGoods(){
+				let newList=[]
+				this.giftList.forEach(item=>{
+					let obj={
+						id:item.id,
+						userId:item.userId,
+						goodsId:item.goodsId,
+						activityIds:item.activityIds,
+						count:item.exCount
+					}
+					newList.push(obj)
+				})
+				return newList
+			},
+			confirm(){
+				this.dialogShow = false;
+				this.getMineGiftList()
 			},
 			navTap() {
+				let newList=[]
+				this.giftList.forEach(item=>{
+					let obj={
+						id:item.id,
+						userId:item.userId,
+						goodsId:item.goodsId,
+						activityIds:item.activityIds,
+						count:item.exCount,
+						goodsPic:item.goods.goodsPic,
+						goodsName:item.goods.goodsName,
+						donateMedalId:item.goods.donateMedalId
+					}
+					newList.push(obj)
+				})
+				let params=JSON.stringify(newList)
 				uni.navigateTo({
-					url: '/pages/activityList/mine/order/orderConfirm'
+					url: '/pages/activityList/mine/order/orderConfirm?goods='+params
 				})
 			},
 			//礼物+
-			plus() {
-				this.count++
+			plus(item) {
+				if (item.exCount<item.count) {
+					item.exCount++
+				}
+				this.$forceUpdate()
 			}, 
 			//礼物 -
-			minus() {
-				if (this.count > 1) {
-					this.count--
+			minus(item) {
+				if (item.exCount>1) {
+					item.exCount--
 				}
+				this.$forceUpdate()
 			},
 		}
 	}

+ 21 - 25
pages/activityList/mine/order/orderConfirm.vue

@@ -3,7 +3,7 @@
 		<view class="container flex align-center justify-between" @click="navTap">
 			<view class="flex padding align-center">
 				<image src="/static/address.png" style="width: 65upx;height: 65upx;"></image>
-				<view class="padding-left text-sm" v-if="writeAddress">
+				<view class="padding-left text-sm" v-if="!$u.test.isEmpty(address)">
 					<view style="font-size: 28upx;font-family: PingFang SC;font-weight: 800;color: #000000;">赖德福 19849015150</view>
 					<view class="text-gray">广东省 广州市 荔湾区 新路街</view>
 				</view>
@@ -16,19 +16,10 @@
 		<block v-for="(item, index) in giftList" :key="index">
 			<view class="card">
 				<view class="padding">
-					<view class="flex justify-between align-center padding-bottom-sm">
-						<view class="flex align-center">
-							<view class="cuIcon-goods padding-right-xs text-bold text-black" style="font-size: 40upx;"></view>
-							<view class="title">{{item.title}}</view>
-						</view>
-					</view>
 					<view class="flex margin-top-xs">
-						<image :src="item.image" style="width: 220upx;height: 220upx;"></image>
+						<image :src="item.goodsPic" style="width: 220upx;height: 220upx;"></image>
 						<view class="padding-left-sm">
-							<view class="name text-cut" style="width: 350upx;">{{item.name}}</view>
-							<view class="specification">
-								<view>{{item.specification}}</view>
-							</view>
+							<view class="name text-cut" style="width: 350upx;">{{item.goodsName}}</view>
 						</view>
 					</view>
 				</view>
@@ -38,13 +29,11 @@
 			</view>
 		</block>
 		<view style="height: 120upx;"></view>
-		<view class="notice text-sm" v-if="giftList.length < 3 && count < 3">
-			提示:该礼包满3个包邮(不满3个运费需要用户自行承担
+		<view class="notice text-sm">
+			提示:该礼包运费需要用户自行承担
 		</view>
 		<view class="footer-fixed flex justify-between align-center padding-sm bg-white">
-			<view v-if="giftList.length < 3 && count < 3">
-				快递配送  配送费¥8
-			</view>
+			<view></view>
 			<button class="cu-btn round text-white theme-bg-color" style="width: 180upx;height: 80upx;" @click="dialog">领取</button>
 		</view>
 		<u-popup v-model="dialogShow" mode="center" width="500" height="480" border-radius="30">
@@ -64,20 +53,26 @@
 	export default {
 		data() {
 			return {
+				userId:'',
 				dialogShow: false,
-				writeAddress: true,
+				writeAddress: false,
+				//我的地址
+				address:{},
 				count: 0,
 				giftList: [],
 			}
 		},
-		onLoad() {
-			this.giftList[0] = {image: '/static/gift/commodity2.png', title: 'lilbetter化妆品旗舰', name: 'Lilbetter发泥男士定型自然', specification: '发泥+洁面乳 120ml', count: 1, selected: true, status: '已完成'};
-			this.giftList[1] = {image: '/static/gift/commodity2.png', title: 'lilbetter化妆品旗舰', name: 'Lilbetter发泥男士定型自然', specification: '发泥+洁面乳 120ml', count: 1, selected: true, status: '已完成'};
-			for (let item of this.giftList) {
-				this.count += item.count;
-			}
+		onLoad(options) {
+			this.giftList=JSON.parse(options.goods)
+			this.userId=this.giftList[0].userId
+			this.getAddress()
 		},
 		methods: {
+			getAddress(){
+				this.$u.api.user.userAddress({userId:this.userId}).then(res=>{
+					this.address=res.records[0]
+				})
+			},
 			dialog() {
 				this.dialogShow = true;
 			},
@@ -88,8 +83,9 @@
 				})
 			},
 			navTap() {
+				let params=JSON.stringify(this.address)
 				uni.navigateTo({
-					url: "/pages/activityList/mine/order/address"
+					url: "/pages/activityList/mine/order/address?address="+params
 				})
 			}
 		}