瀏覽代碼

Merge branch 'master' of http://git.chelingzhu.com/chelingzhu-web/zxyj-mini-html

zhangdan 4 年之前
父節點
當前提交
e693685a4d

+ 11 - 0
.hbuilderx/launch.json

@@ -0,0 +1,11 @@
+{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
+  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
+    "version": "0.0",
+    "configurations": [{
+            "type": "uniCloud",
+            "default": {
+                "launchtype": "remote"
+            }
+        }
+    ]
+}

+ 2 - 2
App.vue

@@ -1,7 +1,7 @@
 <script>
-	const uat_domain = 'https://lese.test.sxzxyj.net' // 预发布
+	const uat_domain = 'https://lese.test.zyucgj.com' // 预发布
 	// const uat_domain = 'http://192.168.16.105:8302' // 本地
-	const pro_domain = 'https://lese.sxzxyj.net' // 生产
+	const pro_domain = 'https://lese.zyucgj.cn' // 生产
 	const uat_URL = uat_domain+'/gc-shop/' // 预发布
 	const pro_URL = pro_domain+'/gc-shop/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布

+ 3 - 1
api/user.js

@@ -25,7 +25,9 @@ export const loginPhone = params => {
 };
 // 乐豆使用明细
 export const ldUsedQuery = params => { 
-  let url = `customerGoldLog/queryByMonth`
+  let url = `customerGoldLog/queryByMonth/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios.request({
     url: url,
     data: params,

+ 4 - 3
components/address.vue

@@ -22,7 +22,7 @@
 				</view>
 			</view>
 			<view class="simple-address__box">
-				<picker-view indicator-style="height: 70rpx;" class="simple-address-view" :value="pickerValue" @change="pickerChange">
+				<picker-view class="simple-address-view" :value="pickerValue" @change="pickerChange">
 					<picker-view-column>
 						<!-- #ifndef APP-NVUE -->
 						<view class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in provinceDataList" :key="index">{{ item.name }}</view>
@@ -317,7 +317,7 @@
 	transition-duration: 0.3s;
 	opacity: 0;
 	/* #ifndef APP-NVUE */
-	z-index: 99;
+	z-index: 99999;
 	/* #endif */
 }
 
@@ -339,11 +339,12 @@
 	bottom: 0;
 	left: 0;
 	right: 0;
+	width: 100%;
 	transition-property: transform;
 	transition-duration: 0.3s;
 	transform: translateY(460rpx);
 	/* #ifndef APP-NVUE */
-	z-index: 99;
+	z-index: 999999;
 	/* #endif */
 }
 

+ 30 - 1
components/uni-cart-fix/uni-cart-fix.vue

@@ -15,6 +15,7 @@
 </template>
 	<script>
 		import dragButton from "@/components/drag-button/drag-button.vue";
+		import {checkLogin} from '@/api/login.js'
 		export default {
 			components: {
 			    dragButton
@@ -32,11 +33,39 @@
 			computed: {
 				count() {
 					return this.$store.state.vuex_cartNums
-				},
+				}
+			},
+			data() {
+				return {
+					hasLogin: false
+				}
+			},
+			mounted() {
+				// 是否登录
+				checkLogin().then(res => {
+					console.log(res,'checkLogin')
+					this.hasLogin = res.status == 200
+				})
 			},
 			methods: {
 				toCart() {
 					let _this = this
+					if(!this.hasLogin) {
+						uni.showModal({
+						  title: '提示',
+						  content: '您尚未登录或登录已过期,请先进行登录',
+						  success (res) {
+						    if (res.confirm) {
+						      uni.navigateTo({
+						          url: '/pages/login/login'
+						      });
+						    } else if (res.cancel) {
+						      console.log('用户点击取消');
+						    }
+						  }
+						});
+						return
+					}
 					if(_this.closeCurPage){
 						uni.redirectTo({
 							url:"/pagesA/cart/cart"

+ 21 - 1
components/uni-coods/uni-coods.vue

@@ -50,6 +50,10 @@
 				default: function(){
 					return []
 				}
+			},
+			hasLogin:{
+				type: Boolean,
+				default: false
 			}
 		},
 		data() {
@@ -102,7 +106,23 @@
 			},
 			// 加入购物车
 			addCart(item) {
-				this.addGoodToCart({goodsNo:item.goodsNo,buyQty:1,hasCunzai:this.hasCunzai(item)})
+				if(!this.hasLogin){
+					uni.showModal({
+					  title: '提示',
+					  content: '您尚未登录或登录已过期,请先进行登录',
+					  success (res) {
+					    if (res.confirm) {
+					      uni.navigateTo({
+					          url: '/pages/login/login'
+					      });
+					    } else if (res.cancel) {
+					      console.log('用户点击取消');
+					    }
+					  }
+					});
+				} else {
+					this.addGoodToCart({goodsNo:item.goodsNo,buyQty:1,hasCunzai:this.hasCunzai(item)})
+				}
 			},
 			// 商品详情
 			toDetail(item){

+ 1 - 2
libs/axios.js

@@ -41,8 +41,7 @@ const request = (opts, hasToken) => {
 						uni.showToast({
 							icon:'none',
 							title: ret.message,
-							mask: true,
-							duration: 5000 
+							mask: true
 						})
 					}
 					resolve(ret)

+ 9 - 2
pages.json

@@ -138,7 +138,15 @@
                 "enablePullDownRefresh": false
             }
             
-        }
+        },
+		{
+			"path" : "pages/webView/webView",
+			"style" :                                                                                    
+			{
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+		}
     ],
 	"subPackages": [{
 		"root": "pagesA",
@@ -253,7 +261,6 @@
 			        "navigationBarTitleText": "我的礼品卡",
 			        "enablePullDownRefresh": false
 			    }
-			    
 			}
             ]
 	}],

+ 9 - 1
pages/checkOut/checkOut.vue

@@ -86,6 +86,7 @@
 <script>
 	import { sellerReceive } from '@/api/user.js'
 	import { existPayPwd } from '@/api/order.js'
+	import md5 from 'md5'
 	export default{
 		data() {
 			return {
@@ -134,6 +135,13 @@
 						})
 						return false
 					}
+					if(this.number<=0){
+						uni.showToast({
+							title: '输入的支付数量不能小于或等于0!',
+							icon: 'none'
+						})
+						return false
+					}
 					existPayPwd().then(res => {
 						console.log(res,'rrrrrr')
 						if(res.status == 200) {
@@ -166,7 +174,7 @@
 					return
 				}
 				let data = {
-					"payPassword": this.password,
+					"payPassword": md5(this.password),
 					"changeNum": this.number,
 					"remarks": this.remarks,
 					"officialPartnerNo": this.partnerNo

+ 4 - 9
pages/goods/index.vue

@@ -11,16 +11,16 @@
 					<view slot="right" style="color: #01c9b2;font-size: 30rpx;">更多<u-icon name="arrow-right"></u-icon></view>
 				</u-section>
 				<view class="goods-list">
-					<uni-coods :goldLimit="item.type.goldLimit" :list="item.list"></uni-coods>
+					<uni-coods :goldLimit="item.type.goldLimit" :hasLogin="hasLogin" :list="item.list"></uni-coods>
 				</view>
 			</view>
-			<view v-if="goodsListLength==0&&hasLogin">
+			<view v-if="goodsListLength==0">
 				<u-empty icon-size="60" :text="noDataText" mode="list"></u-empty>
 			</view>
-			<view class="nologin" v-if="!hasLogin"> 
+			<!-- <view class="nologin" v-if="!hasLogin"> 
 				<view>您还未登录,请登录后再浏览商品</view>
 				<u-button plain size="mini" shape="circle" @click="toLoginPage">立即登录</u-button>
-			</view>
+			</view> -->
 		</view>
 		<!-- 购物车 -->
 		<uni-cart-fix :dragPic="dragPic"></uni-cart-fix>
@@ -65,11 +65,6 @@
 			// 是否登录
 			checkLogin().then(res => {
 				this.hasLogin = res.status == 200
-				// if(res.status != 200){
-				// 	uni.navigateTo({
-				// 		url:"/pages/login/login"
-				// 	})
-				// }
 			})
 		},
 		// 下拉刷新

+ 19 - 11
pages/index/index.vue

@@ -275,9 +275,9 @@
 				let row = this.imageTopList[index]
 				console.log(index,row)
 				if(row.jumpType !== 'NONE'){
-					if(this.hasLogin){
-						// 如果是大转盘
-						if(row.jumpUrl.indexOf('pagesA/luckDraw') >= 0){
+					// 如果是大转盘
+					if(row.jumpUrl.indexOf('pagesA/luckDraw') >= 0){
+						if(this.hasLogin){
 							if(this.showFixedLottery){
 								uni.navigateTo({
 									url:row.jumpUrl
@@ -288,13 +288,20 @@
 									title: '活动已结束'
 								})
 							}
+						}else{
+							this.toLoginPage()
+						}
+					}else{
+						// 判断是否是调整tab页
+						if(row.jumpType == "TAB_PAGE"){
+							uni.switchTab({
+								url:row.jumpUrl
+							})
 						}else{
 							uni.navigateTo({
 								url: row.jumpUrl
 							})
 						}
-					}else{
-						this.toLoginPage()
 					}
 				}
 			},
@@ -367,7 +374,7 @@
 						// 普通二维码,用户扫箱体的二维码开箱
 						if(e.scanType == 'QR_CODE'){
 							let params = parseQueryString(e.result)
-							console.log(params)
+							console.log(params,'---------------')
 							if(params.codeType == 'hexiao'){  //  扫商户码
 								_this.getStoreData(params.officialPartnerNo)
 							}else{  //  扫箱体码
@@ -409,13 +416,14 @@
 			// 开箱
 			openDevice(data){
 				let params = parseQueryString(data)
+				console.log(params)
 				openDevice(params).then(res => {
-					console.log(res)
+					console.log(res,'-------------扫码开箱')
 					if(res.status == 200){
-						// uni.showToast({
-						// 	icon:"none",
-						// 	title:"认证成功,请点击设备开启按钮"
-						// })
+						uni.showToast({
+							icon:"none",
+							title:"扫码成功"
+						})
 					}
 				})
 			},

+ 21 - 6
pages/login/login.vue

@@ -36,6 +36,7 @@
 				path: '/pages/index/index',
 				lanuch: false,
 				code: '',
+				url:'', // 二维码参数
 				wxButton: {
 					background: '#07c160'
 				},
@@ -46,6 +47,9 @@
 		},
 		mounted() {},
 		onLoad(option) {
+			if(option.q !=undefined){
+				this.url=decodeURIComponent(option.q)
+			}
 			// 开启分享
 			uni.showShareMenu({
 				withShareTicket: true,
@@ -86,11 +90,15 @@
 				console.log(this.code, e)
 				if (e.target.errMsg === 'getPhoneNumber:ok') {
 					setTimeout(()=>{
-						login({
+						const params={
 							code: _this.code,
 							encryptedData: e.target.encryptedData,
-							iv: e.target.iv
-						}).then(res => {
+							iv: e.target.iv,
+						}
+						if(_this.url){
+							params.encode=_this.url
+						}
+						login(params).then(res => {
 							uni.hideLoading();
 							_this.code = ''
 							console.log(res,_this.path, 'login data')
@@ -137,9 +145,16 @@
 			},
 			// 手机号登录
 			phoneLogin () {
-			  wx.navigateTo({
-			    url: '/pages/login/phoneLogin?path='+this.path+'&lanuch='+this.lanuch
-			  })
+				if(this.url){
+					wx.navigateTo({
+						url: '/pages/login/phoneLogin?path='+this.path+'&lanuch='+this.lanuch+'&encode='+this.url 
+					})
+				}else{
+					wx.navigateTo({
+						url: '/pages/login/phoneLogin?path='+this.path+'&lanuch='+this.lanuch
+					})
+				}
+			  
 			}
 		}
 	}

+ 10 - 2
pages/login/phoneLogin.vue

@@ -50,9 +50,13 @@
 				wxcode: '',
 				path: '/pages/index/index',
 				lanuch: false,
+				encode:'' // 二维码地址
 			}
 		},
 		onLoad(opts) {
+			console.log(opts,'----参数')
+			this.encode=opts.encode
+			console.log(opts,this.encode,'----参数')
 			// 开启分享
 			uni.showShareMenu({
 				withShareTicket: true,
@@ -60,8 +64,10 @@
 			})
 			const {
 				path,
-				lanuch
+				lanuch,
+				encode
 			} = option;
+			// console.log(option,'----参数')
 			this.lanuch = (lanuch + '') === 'true';
 		},
 		onUnload() {
@@ -89,7 +95,9 @@
 				obj.phone = _this.form.phone
 				obj.random = _this.randomCode  // 当前随机码
 				obj.verifiCode = _this.form.verifyCode
-				
+				if(this.encode){
+					obj.encode=this.encode
+				}
 				uni.login({
 					provider: 'weixin',
 					success(res) {

+ 4 - 0
pages/userCenter/deliveryRecord.vue

@@ -95,8 +95,12 @@
 </script>
 
 <style lang="less">
+	page{
+		height: 100%;
+	}
 	.deliveryRecord-container{
 		width: 100%;
+		height: 100%;
 		//  列表
 		.scroll-con{
 			height: 100%;

+ 49 - 2
pages/userCenter/index.vue

@@ -7,7 +7,8 @@
 				<u-image v-show="!hasLogin" src="/static/logo.png" width="100" height="100"></u-image>
 			</view>
 			<view class="user-info">
-				<text v-if="hasLogin">{{user.mobile||'--'}}</text>
+				<view v-if="hasLogin" class="user-info-item">{{user.mobile||'--'}}</view>
+				<view v-if="hasLogin" class="user-info-item">注册时间:{{user.registerTime||'--'}}</view>
 				<u-button v-else="!hasLogin" plain size="mini" shape="circle" @click="toLoginPage">立即登录</u-button>
 			</view>
 			<view v-if="hasLogin">
@@ -34,6 +35,7 @@
 				<u-cell-item icon="phone" icon-size="40" :icon-style="{color:'#f00'}" @click="callPhone" title="联系客服"></u-cell-item>
 				<u-cell-item icon="file-text" icon-size="40" :icon-style="{color:'#ffaa00'}" index="3" @click="toPage" title="服务协议"></u-cell-item>
 				<u-cell-item icon="info-circle" icon-size="38" :icon-style="{color:'#55aa00'}" index="4" @click="toPage" title="关于我们"></u-cell-item>
+				<u-cell-item  icon="error-circle" icon-size="38" :icon-style="{color:'#aaaaff'}" :value="version" @click="checkUpdate" title="版本检查"></u-cell-item>
 			</u-cell-group>
 		</view>
 	</view>
@@ -45,7 +47,8 @@
 		data() {
 			return {
 				hasLogin: false,
-				userData: {}
+				userData: {},
+				version: ''
 			};
 		},
 		onShow() {
@@ -80,9 +83,50 @@
 					if(res.status == 200){
 						this.$u.vuex("vuex_userData",res.data)
 						this.userData = res.data
+						console.log(this.userData,'-----用户信息')
 					}
 				})
 			},
+			// 获取当前小程序版本
+			getVersion(){
+				const accountInfo = uni.getAccountInfoSync();
+				this.version = accountInfo.miniProgram.version
+				// console.log(accountInfo,accountInfo.miniProgram.appId,'ppppppppp'); // 小程序 appId
+			},
+			// 检查更新
+			checkUpdate(){
+				if (uni.canIUse('getUpdateManager')) {
+				      const updateManager = uni.getUpdateManager()
+				      updateManager.onCheckForUpdate(function (res) {
+				        console.log('onCheckForUpdate====', res)
+				        // 请求完新版本信息的回调
+				        if (res.hasUpdate) {
+				          console.log('res.hasUpdate====')
+				          updateManager.onUpdateReady(function () {
+				            uni.showModal({
+				              title: '更新提示',
+				              content: '新版本已经准备好,是否重启应用?',
+				              success: function (res) {
+				                console.log('success====', res)
+				                // res: {errMsg: "showModal: ok", cancel: false, confirm: true}
+				                if (res.confirm) {
+				                  // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+				                  updateManager.applyUpdate()
+				                }
+				              }
+				            })
+				          })
+				          updateManager.onUpdateFailed(function () {
+				            // 新的版本下载失败
+				            uni.showModal({
+				              title: '已经有新版本了哟~',
+				              content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
+				            })
+				          })
+				        }
+				      })
+				    }
+			},
 			// 打开对应的页面
 			toPage(index){
 				console.log(index)
@@ -146,6 +190,9 @@
 				flex-grow: 1;
 				padding: 0 20rpx;
 				color: #FFFFFF;
+				.user-info-item{
+					margin: 10rpx 0;
+				}
 			}
 			.user-photo{
 				width: 100rpx;

+ 45 - 25
pages/userCenter/ldDetailed.vue

@@ -2,31 +2,31 @@
 	<view class="ldDetailed-container">
 		<!-- 筛选菜单 -->
 		<u-dropdown ref="uDropdown" class="filter-dropdown">
-			<u-dropdown-item v-model="queryParam.changeType" :title="titType" :options="optionsType" @change="searchHandle()"></u-dropdown-item>
-			<u-dropdown-item v-model="timeScope" :title="titScope" :options="optionsScope" @change="searchHandle()"></u-dropdown-item>
+			<u-dropdown-item v-model="queryParam.changeType" :title="titType" :options="optionsType" @change="searchHandle(1)"></u-dropdown-item>
+			<u-dropdown-item v-model="timeScope" :title="titScope" :options="optionsScope" @change="searchHandle(1)"></u-dropdown-item>
 		</u-dropdown>
 		<scroll-view class="scroll-con" scroll-y @scrolltolower="onreachBottom">
 			<!-- 列表数据 -->
 			<view class="cell-item-con">
 				<view class="cell-item" v-for="(item, index) in listdata" :key="index">
-					<text class="cell-item-month" v-if="timeScope == 'threeMonth'">{{item.month}}</text>
-					<view class="cell-item-main" v-for="(subItem, ind) in item.monthDataList" :key="ind">
+					<!-- <text class="cell-item-month" v-if="timeScope == 'threeMonth'">{{item.month}}</text> -->
+					<view class="cell-item-main" >
 						<view :class="['cell-item-pic']">
-							<u-image mode="scaleToFill" v-if="subItem.changeType == 'ADD'" shape="circle" width="70rpx" height="70rpx" src="/static/tudi.png"></u-image>
+							<u-image mode="scaleToFill" v-if="item.changeType == 'ADD'" shape="circle" width="70rpx" height="70rpx" src="/static/tudi.png"></u-image>
 							<u-image mode="scaleToFill" v-else shape="circle" width="70rpx" height="70rpx" src="/static/bued.png"></u-image>
 						</view>
 						<view class="cell-item-c">
-							<text class="cell-item-des">{{subItem.operateTypeDictValue||'--'}}</text>
-							<text class="cell-item-date">{{subItem.createDate}}</text>
+							<text class="cell-item-des">{{item.operateTypeDictValue||'--'}}</text>
+							<text class="cell-item-date">{{item.createDate}}</text>
 						</view>
-						<view :class="['cell-item-score', subItem.changeType == 'ADD' ? 'black' : 'red']">
-							<text>{{subItem.changeType == 'ADD' ? '+'+subItem.changeNum : '-'+subItem.changeNum}}</text>
+						<view :class="['cell-item-score', item.changeType == 'ADD' ? 'black' : 'red']">
+							<text>{{item.changeType == 'ADD' ? '+'+item.changeNum : '-'+item.changeNum}}</text>
 							<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
 						</view>
 					</view>
-					<view class="nodata" v-if="item.monthDataList.length==0 && status!='loading'">
+					<!-- <view class="nodata" v-if="item.monthDataList.length==0 && status!='loading'">
 						<u-empty :text="noDataText" mode="list"></u-empty>
-					</view>
+					</view> -->
 				</view>
 			</view>
 			<view class="nodata" v-if="listdata.length==0 && status!='loading'">
@@ -48,7 +48,7 @@
 			return {
 				listdata: [],
 				pageNo: 1,  //  当前页码
-				pageSize: 10,  //  每页条数
+				pageSize: 20,  //  每页条数
 				total: 0,  //  数据总条数
 				noDataText: '暂无数据',  //  列表请求状态提示语
 				status: 'loadmore',  //  加载中状态
@@ -64,7 +64,7 @@
 			}
 		},
 		onShow() {
-			this.searchHandle()
+			this.searchHandle(1)
 		},
 		onLoad() {
 			this.timeScope = 'threeMonth'
@@ -114,31 +114,44 @@
 		},
 		methods:{
 			// 搜索查询
-			searchHandle () {
-				this.listdata = []
+			searchHandle (pageNo) {
+				this.pageNo = pageNo ? pageNo : this.pageNo
+				if(this.pageNo == 1){
+					this.listdata = []
+				}
 				this.status = "loading"
 				let params = Object.assign(this.queryParam,this.queryDate)
+				params.pageNo = this.pageNo
+				params.pageSize = this.pageSize
 				console.log(params,'pppppppp')
 				ldUsedQuery(params).then(res => {
 					console.log(res,'pppppppp')
 					if (res.status == 200) {
-						let list = res.data
-						// 查询3个月时 数据处理
-						if (this.timeScope == 'threeMonth') {
-							list.map(item=>{
-								let m = moment(item.month).month()+1
-								item.month = (m == moment().month()+1) ? '本月' : m+'月'
-							})
+						if(this.pageNo>1){
+							this.listdata = this.listdata.concat(res.data.list || [])
+						}else{
+							this.listdata = res.data.list || []
 						}
-						this.listdata = list
+						this.total = res.data.count || 0
 					} else {
 						this.noDataText = res.message
 						this.listdata = []
 						this.total = 0
 					}
-					this.status = "nomore"
+					this.status = "loadmore"
 				})
 			},
+			// scroll-view到底部加载更多
+			onreachBottom() {
+				console.log(111111)
+				if(this.listdata.length < this.total){
+					this.pageNo += 1
+					this.searchHandle()
+				}else{
+					uni.showToast({ title: '已经到底了', icon: 'none' })
+					this.status = "nomore"
+				}
+			}
 		}
 	}
 </script>
@@ -151,6 +164,8 @@
 	.ldDetailed-container{
 		width: 100%;
 		height: 100%;
+		display: flex;
+		flex-direction: column;
 		.nodata{
 			margin: 50upx 0;
 		}
@@ -160,10 +175,15 @@
 			.u-dropdown__menu__item{
 				background-color: #fff!important;
 			}
+			
+		}
+		> u-dropdown{
+			flex: none !important;
 		}
 		//  列表
 		.scroll-con{
-			height: calc(100% - 40);
+			// height: calc(100% - 40);
+			flex: 1;
 			overflow: auto;
 		}
 		//  列表样式

+ 43 - 0
pages/webView/webView.vue

@@ -0,0 +1,43 @@
+<template>
+	 <view>
+		<web-view :src="src"></web-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				src: '' //H5页面路径
+			}
+		},
+		onLoad(option) {
+			// console.log(option,'option')
+			this.src = option.src
+			// 开启分享
+			uni.showShareMenu({
+				withShareTicket: true,
+				menus: ['shareAppMessage', 'shareTimeline']
+			})
+		},
+		methods: {
+			
+		},
+		onShareAppMessage(res){
+			return {
+				title:'',
+				path:'pages/webView/webView?src='+this.src
+			}
+		},
+		onShareTimeline(res){
+			return {
+				title:'',
+				path:'pages/webView/webView',
+				query:'src='+this.src
+			}
+		}
+	}
+</script>
+
+<style>
+</style>

+ 9 - 1
pagesA/goods/goods.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view v-if="goldLimit>0" class="info">该类商品需购满{{goldLimit}}乐豆才能下单哦!</view>
 		<view v-if="goodsList.length">
-			<uni-coods :list="goodsList"></uni-coods>
+			<uni-coods :hasLogin="hasLogin" :list="goodsList"></uni-coods>
 			<view class="loadmore"><u-loadmore @loadmore="loadmore" :status="status" /></view>
 		</view>
 		<!-- 购物车 -->
@@ -14,6 +14,7 @@
 	import {
 		getGoodsList
 	} from '@/api/goods.js'
+	import {checkLogin} from '@/api/login.js'
 	export default {
 		data() {
 			return {
@@ -26,6 +27,7 @@
 				status: 'loadmore',
 				count: 0,
 				dragPic: '/static/cart.png',  //  购物车图标
+				hasLogin: false
 			};
 		},
 		onLoad(opts) {
@@ -51,6 +53,12 @@
 				uni.stopPullDownRefresh()
 			}, 200)
 		},
+		onShow() {
+			// 是否登录
+			checkLogin().then(res => {
+				this.hasLogin = res.status == 200
+			})
+		},
 		methods: {
 			// 查询商品
 			getGoods(item,index){

+ 33 - 3
pagesA/goods/goodsDetail.vue

@@ -48,8 +48,8 @@
 		</view>
 		<!-- 底部浮动按钮 -->
 		<view class="bottom-btns" v-if="goodContent&&goodContent.inventoryQty > 0&&goodContent.state==1">
-			<view><u-button :custom-style="addCartButton" type="warning" @click="addCart">加入购物车</u-button></view>
-			<view><u-button :custom-style="toOrderButton" type="error" @click="toOrder()">立即下单</u-button></view>
+			<view><u-button :custom-style="addCartButton" type="warning" @click="checkLogin(0)">加入购物车</u-button></view>
+			<view><u-button :custom-style="toOrderButton" type="error" @click="checkLogin(1)">立即下单</u-button></view>
 		</view>
 		<!-- 购物车 -->
 		<uni-cart-fix :closeCurPage="true" :dragPic="dragPic"></uni-cart-fix>
@@ -63,6 +63,7 @@
 	import {
 		addGoodsToCart
 	} from '@/api/shoppingCart.js'
+	import {checkLogin} from '@/api/login.js'
 	import jyfParser from "@/components/jyf-parser/jyf-parser";
 	export default {
 		components: {
@@ -83,7 +84,8 @@
 				goodContent: null,
 				goldLimit: 0,
 				dragPic: '/static/cart.png',  //  购物车图标
-				userData: null
+				userData: null,
+				hasLogin: false
 			};
 		},
 		onLoad(opts) {
@@ -141,6 +143,34 @@
 				let row = list.find(item=> item.goodsTypeNo == data.goodsTypeNo)
 				return row
 			},
+			// 是否登录 flag: 0 加入购物车 1 立即下单
+			checkLogin(flag) {
+				// 是否登录
+				checkLogin().then(res => {
+					this.hasLogin = res.status == 200
+					if(this.hasLogin) {
+						if(flag) {
+							this.toOrder()
+						} else {
+							this.addCart()
+						}
+					} else {
+						uni.showModal({
+						  title: '提示',
+						  content: '您尚未登录或登录已过期,请先进行登录',
+						  success (res) {
+						    if (res.confirm) {
+						      uni.navigateTo({
+						          url: '/pages/login/login'
+						      });
+						    } else if (res.cancel) {
+						      console.log('用户点击取消');
+						    }
+						  }
+						});
+					}
+				})
+			},
 			// 加入购物车
 			addCart() {
 				let item = this.goodContent

+ 9 - 10
pagesA/luckDraw/myJp.vue

@@ -12,7 +12,7 @@
 				<u-button size="mini" @click="goBack">去抽奖</u-button>
 			</view> -->
 		</view>
-		
+		<Address ref="applyAddress" @onConfirm="areaConfirm"></Address>
 		<!-- 查看详情弹框 -->
 		<u-popup v-model="showViews" mode="center" close-icon-color="#ffffff" closeable :border-radius="30" width="500rpx">
 			<view class="lottery-content">
@@ -73,7 +73,6 @@
 					 	</u-form-item>
 					 	<u-form-item label="省市区" required prop="receiveAreasName">
 					 		<u-input v-model="areaInfo.label" placeholder="请选择省市区" @click="openAddress" type="select" />
-					 		<Address ref="applyAddress" @onConfirm="areaConfirm"></Address>
 					 	</u-form-item>
 					 	<u-form-item label="详细地址" :border-bottom="false" required prop="receiveAddress">
 					 		<!-- <u-input type="textarea" :height="100" auto-height placeholder="请输入收货详细地址(最多100个字符)" :maxlength="100" v-model="form.receiveAddress" class="receiveAddress"/> -->
@@ -86,7 +85,6 @@
 				</view>
 			</view>
 		</u-popup>
-		
 	</view>
 </template>
 
@@ -265,13 +263,15 @@ export default {
 					if(this.form.id) {
 						params.id = this.form.id
 					}
+					// 更新收货地址
+					this.saveReceive(params)
 					// 保存我的收货地址
-					saveAddress(params).then(res=>{
-						if(res.status == 200) {
-							// 保存领奖收货信息
-							this.saveReceive(params)
-						} 
-					})
+					// saveAddress(params).then(res=>{
+					// 	if(res.status == 200) {
+					// 		// 保存领奖收货信息
+					// 		this.saveReceive(params)
+					// 	} 
+					// })
 				}
 			});
 		},
@@ -348,7 +348,6 @@ export default {
 		}
 		.lottery-content{
 			height: 100%;
-			position: relative;
 			background: url(../../static/lottery_winbg1.png) no-repeat center top;
 			background-size: 100% auto;
 			.lottery-confrim-btn{