فهرست منبع

Merge branch 'develop' of chelingzhu-web/zxyj-mini-html into master

lilei 4 سال پیش
والد
کامیت
2458d9c636
9فایلهای تغییر یافته به همراه113 افزوده شده و 42 حذف شده
  1. 2 2
      App.vue
  2. 13 5
      pages/cart/cart.vue
  3. 16 8
      pages/goods/goodsDetail.vue
  4. 25 15
      pages/goods/index.vue
  5. 43 9
      pages/index/index.vue
  6. 1 1
      pages/login/login.vue
  7. 10 1
      pages/order/order.vue
  8. 2 1
      pages/order/orderDetail.vue
  9. 1 0
      pages/toOrder/index.vue

+ 2 - 2
App.vue

@@ -1,6 +1,6 @@
 <script>
-	// const uat_domain = 'https://lese.test.sxzxyj.net' // 预发布
-	const uat_domain = 'http://192.168.16.102:8302' // 本地
+	const uat_domain = 'https://lese.test.sxzxyj.net' // 预发布
+	// const uat_domain = 'http://192.168.16.103:8302' // 本地
 	const pro_domain = 'https://lese.sxzxyj.net' // 生产
 	const uat_URL = uat_domain+'/gc-shop/' // 预发布
 	const pro_URL = pro_domain+'/gc-shop/'  // 生产

+ 13 - 5
pages/cart/cart.vue

@@ -53,9 +53,9 @@
 								<view class="goods-price">
 									<view>
 										<text>{{good.goods.sellGold}}</text>
-										<image mode="scaleToFill" style="width: 30rpx;height: 30rpx;"src="/static/ledou.png"></image>
+										<image mode="scaleToFill" style="width: 30rpx;height: 30rpx;" src="/static/ledou.png"></image>
 									</view>
-									<view v-if="good.goods.inventoryQty>0&&good.goods.state==1">
+									<view v-if="good.goods.inventoryQty>0&&good.goods.state==1&&good.goods.sellGold>0">
 										<uni-numbers-box @change="goodsNumsChange()" :index="cindex+'-'+index" :value="good.buyQty" :max="good.goods.inventoryQty" :min="1"></uni-numbers-box>
 									</view>
 									<view v-else>
@@ -70,7 +70,7 @@
 					<!-- 小计 -->
 					<view class="goods-class-heji">
 						<view>合计:<text>{{item.total}}</text></view>
-						<image mode="scaleToFill" style="width: 30rpx;height: 30rpx;"src="/static/ledou.png"></image>
+						<image mode="scaleToFill" style="width: 30rpx;height: 30rpx;" src="/static/ledou.png"></image>
 					</view>
 				</view>
 			</view>
@@ -235,7 +235,7 @@
 			setClsGoodStatus(item,checked){
 				item.shoppingCartGoodsList.map(good=>{
 					// 已下架,已删除,已销完的不选
-					if((good.goods.inventoryQty==0||good.goods.state == 0) && !this.isEdit){
+					if((good.goods.inventoryQty==0||good.goods.state == 0||good.goods.sellGold<=0) && !this.isEdit){
 						good.checked = false
 					}else{
 						good.checked = checked
@@ -269,7 +269,7 @@
 			},
 			// 判断某个商品是否失效
 			isSxGood(item){
-				return !(item.goods.inventoryQty==0||item.goods.state == 0||item.goods.delFlage == 0) || this.isEdit
+				return !(item.goods.inventoryQty==0||item.goods.state == 0||item.goods.delFlage == 0)&&item.goods.sellGold > 0 || this.isEdit
 			},
 			// 判断分类下商品是否都是已失效
 			isSxGoodAll(row){
@@ -334,7 +334,15 @@
 			},
 			// 立即下单
 			toOrder(){
+				if(this.userData.customerRole == 9){
+					uni.showToast({
+						icon:"none",
+						title:"抱歉,您目前无法使用乐豆"
+					})
+					return
+				}
 				let goods = this.getCheckGoods(1)
+				console.log(goods)
 				if(this.userData.currentGold >= this.totalPrice){
 					if(goods.length){
 						// 判断是否满足规则

+ 16 - 8
pages/goods/goodsDetail.vue

@@ -83,11 +83,13 @@
 				goodContent: null,
 				goldLimit: 0,
 				dragPic: '/static/cart.png',  //  购物车图标
+				userData: null
 			};
 		},
 		onLoad(opts) {
 			console.log(opts)
 			this.id = opts.id
+			this.userData = this.$store.state.vuex_userData
 			this.getDetail()
 		},
 		methods: {
@@ -141,17 +143,23 @@
 			},
 			// 立即下单
 			toOrder(){
-				// console.log(this.goodContent,this.id,'pppppppp')
-				if(this.goodContent.sellGold * this.nums >= this.goldLimit){
-					this.$u.vuex("vuex_toOrderList",[{id:this.id,buyQty:this.nums,goodsNo:this.goodContent.goodsNo,goods:this.goodContent}])
-					uni.redirectTo({
-						url:"/pages/toOrder/index?orderForm=ORDER_NOW"
-					})
-				}else{
+				if(this.userData.customerRole == 9){
 					uni.showToast({
 						icon:"none",
-						title:"此商品需要满" +this.goldLimit+ "乐豆才可购买"
+						title:"抱歉,您目前无法使用乐豆"
 					})
+				}else{
+					if(this.goodContent.sellGold * this.nums >= this.goldLimit){
+						this.$u.vuex("vuex_toOrderList",[{id:this.id,buyQty:this.nums,goodsNo:this.goodContent.goodsNo,goods:this.goodContent}])
+						uni.redirectTo({
+							url:"/pages/toOrder/index?orderForm=ORDER_NOW"
+						})
+					}else{
+						uni.showToast({
+							icon:"none",
+							title:"此类商品需要满" +this.goldLimit+ "乐豆才可购买"
+						})
+					}
 				}
 			}
 		},

+ 25 - 15
pages/goods/index.vue

@@ -7,7 +7,9 @@
 		<!-- 商品 -->
 		<view class="goods">
 			<view v-for="(item,index) in goodsList" :key="index" v-if="item&&item.list.length">
-				<u-section :title="item.type.name" font-size="35" line-color="#01c9b2" sub-title="更多" @click="toGoods(item.type)"></u-section>
+				<u-section :title="item.type.name" font-size="35" line-color="#01c9b2" sub-title="更多" @click="toGoods(item.type)">
+					<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>
 				</view>
@@ -45,7 +47,8 @@
 		},
 		computed: {
 			goodsListLength() {
-				return this.goodsList.length
+				let len  = this.goodsList.length
+				return len
 			}
 		},
 		onShow() {
@@ -61,6 +64,7 @@
 		// 下拉刷新
 		onPullDownRefresh() {
 			console.log('refresh')
+			this.noDataText = '正在加载...'
 			this.pageInit()
 			setTimeout(function () {
 				uni.stopPullDownRefresh()
@@ -83,6 +87,25 @@
 					}
 				})
 			},
+			// 查询商品
+			getGoods(item,index){
+				getGoodsList({
+						pageNo:1,
+						pageSize:item.popularizeGoodsLimit,
+						goodsTypeNo:item.goodsTypeNo,
+					}).then(res => {
+					console.log(res,'goodsList')
+					if(res.status == 200&&res.data.list&&res.data.list.length){
+						this.goodsList[index] = {
+							type: item,
+							list: res.data.list
+						}
+						this.goodsList.splice()
+					}else{
+						this.noDataText = '暂无商品'
+					}
+				})
+			},
 			// 点击banner
 			clickBanner(index){
 				let row = this.imageTopList[index]
@@ -114,19 +137,6 @@
 					url:"/pages/goods/goods?goodsTypeNo="+ item.goodsTypeNo + "&goldLimit="+ item.goldLimit + "&name=" + item.name
 				})
 			},
-			// 查询商品
-			getGoods(item,index){
-				getGoodsList({pageNo:1,pageSize:item.popularizeGoodsLimit,goodsTypeNo:item.goodsTypeNo}).then(res => {
-					console.log(res,'goodsList')
-					if(res.status == 200&&res.data.list&&res.data.list.length){
-						this.goodsList[index] = {
-							type: item,
-							list: res.data.list
-						}
-						this.goodsList.splice()
-					}
-				})
-			}
 		}
 	}
 </script>

+ 43 - 9
pages/index/index.vue

@@ -80,10 +80,13 @@
 			return {
 				imageTopList: [],
 				stationDataList: [] ,//  附近网点列表
-				hasLogin: false
+				hasLogin: false,
+				userData: null
 			}
 		},
 		onLoad() {
+			// 检查更新
+			this.checkUpdate()
 			// 查询购物车列表
 			this.getCartList()
 			// 刷新购物车列表
@@ -124,9 +127,32 @@
 			})
 		},
 		methods: {
+			checkUpdate(){
+				const updateManager = uni.getUpdateManager();
+				updateManager.onCheckForUpdate(function (res) {
+				  // 请求完新版本信息的回调
+				  console.log(res.hasUpdate);
+				});
+				updateManager.onUpdateReady(function (res) {
+				  uni.showModal({
+				    title: '更新提示',
+				    content: '新版本已经准备好,是否重启应用?',
+				    success(res) {
+				      if (res.confirm) {
+				        // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+				        updateManager.applyUpdate();
+				      }
+				    }
+				  });
+				});
+				updateManager.onUpdateFailed(function (res) {
+				  // 新的版本下载失败
+				});
+			},
 			// 获取用户信息
 			getUserInfo(){
 				getUserInfo().then(res => {
+					console.log('getUserInfo',res.data)
 					if(res.status == 200){
 						this.$u.vuex("vuex_userData",res.data)
 					}
@@ -275,14 +301,22 @@
 			},
 			// 扫商户码,获取商户信息
 			getStoreData(params) {
-				sellerFindByPartnerNo({officialPartnerNo: params}).then(res => {
-					if(res.status == 200){
-						let store = res.data
-						uni.navigateTo({
-							url: '/pages/checkOut/checkOut?store='+encodeURIComponent(JSON.stringify(store))
-						})
-					} 
-				})
+				let userData = this.$store.state.vuex_userData
+				if(userData.customerRole == 9){
+					uni.showToast({
+						icon:"none",
+						title:"抱歉,您目前无法使用乐豆"
+					})
+				}else{
+					sellerFindByPartnerNo({officialPartnerNo: params}).then(res => {
+						if(res.status == 200){
+							let store = res.data
+							uni.navigateTo({
+								url: '/pages/checkOut/checkOut?store='+encodeURIComponent(JSON.stringify(store))
+							})
+						} 
+					})
+				}
 			},
 			// 开箱
 			openDevice(data){

+ 1 - 1
pages/login/login.vue

@@ -7,7 +7,7 @@
 				</view>
 				<view class="login-btns">
 					<u-button shape="circle" :custom-style="wxButton" class="login-btn" type="success" :hair-line="false" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
-						微信登
+						微信登
 					</u-button>
 					<u-gap height="30"></u-gap>
 					<u-button shape="circle" :custom-style="phoneButton" class="login-btn" @click="phoneLogin" type="primary">

+ 10 - 1
pages/order/order.vue

@@ -186,10 +186,12 @@
 				showSetPswModal: false,  // 设置支付密码弹窗
 				showInputPsw: false, // 打开输入密码弹窗
 				showLeavePsw: false, // 打开确定放弃弹窗
-				payFinish: false  // 是否支付成功
+				payFinish: false  ,// 是否支付成功
+				userData: null
 			}
 		},
 		onLoad() {
+			this.userData = this.$store.state.vuex_userData
 			// 监听设置密码是否成功
 			uni.$once('setPswSuccess', this.setPsw)
 			// 监听页面刷新事件 在详情支付成功后或在物流确认收货后刷新列表
@@ -358,6 +360,13 @@
 			},
 			// 支付 判断用户是否设置过支付密码
 			toPay(item) {
+				if(this.userData.customerRole == 9){
+					uni.showToast({
+						icon:"none",
+						title:"抱歉,您目前无法使用乐豆"
+					})
+					return
+				}
 				this.orderId = item.id
 				this.totalPrice = item.originalGold
 				this.payFinish = false

+ 2 - 1
pages/order/orderDetail.vue

@@ -322,11 +322,12 @@
 				padding: 20upx 0;
 
 				>view {
-					line-height: 60upx;
+					line-height: 40upx;
 				}
 
 				.address-title {
 					color: #000;
+					word-break: break-all;
 				}
 			}
 

+ 1 - 0
pages/toOrder/index.vue

@@ -326,6 +326,7 @@ page{
 			padding: 10upx;
 			.address{
 				padding: 5upx 0;
+				word-break: break-all;
 			}
 			&:last-child{
 				padding: 0 20upx;