hwq 2 years ago
parent
commit
7945a8f9f7

+ 1 - 1
pages/index/index.vue

@@ -120,7 +120,7 @@
 				</view>
 			</view>
 			<view class="serve-main flex">
-				<view class="serve-item" @click="nav('/pages/store/storeInfo?id?=' + item.id)" v-for="(item, index) in stop" :key="index">
+				<view class="serve-item" @click="nav('/pages/store/storeInfo?id=' + item.id)" v-for="(item, index) in stop" :key="index">
 					<image class="serve-price" :src="item.image" mode=""></image>
 					<view class="clamp serve-title">{{ item.name }}</view>
 					<view class="serve-address flex">

+ 14 - 0
pages/money/recharge.vue

@@ -132,6 +132,19 @@
 					url: url
 				});
 			},
+			// 更新数据
+			dataUp() {
+				let obj = this;
+				getUserInfo({})
+					.then(e => {
+						obj.login();
+						// 保存返回用户数据
+						obj.setUserInfo(e.data);
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
 			// 切换选中对象
 			tabRadio(e) {
 				this.type = e;
@@ -180,6 +193,7 @@
 			 				});
 							}
 						});
+						
 						obj.payLoding = false;
 					})
 					.catch(e => {

+ 11 - 13
pages/order/createOrder.vue

@@ -60,7 +60,10 @@
 					<text class="title clamp">{{ ls.productInfo.store_name }}</text>
 					<text class="spec">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.suk : '默认' }}</text>
 					<view class="price-box">
-						<text class="price">¥{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price : ls.productInfo.price }}</text>
+						<text class="price">¥{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price : ls.productInfo.price }}</text>
+						<text class="price" v-if="ls.productInfo.integral > 0 || ls.productInfo.attrInfo.integral > 0">
+							+{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.integral : ls.productInfo.integral }}趣豆
+						</text>
 						<text class="number">{{ 'x ' + ls.cart_num + (ls.productInfo.unit_name || '') }}</text>
 						<!-- <view><text class="price">¥{{lss.price}}</text></view> -->
 						<!-- <view class="number">
@@ -130,7 +133,9 @@
 			<view class="price-content">
 				<text>实付款</text>
 				<text class="price-tip">¥</text>
-				<text class="price">{{ payPrice }}</text>
+				<text class="price">{{ payPrice }}</text>
+				<text class="price-tip" v-if="payIntegral > 0">+</text>
+				<text class="price" v-if="payIntegral > 0">{{ payIntegral }}趣豆</text>
 			</view>
 			<text class="submit" :class="{ submitNo: !payType }" @click="payType ? submit() : ''">提交订单</text>
 		</view>
@@ -181,7 +186,8 @@ export default {
 				}
 			],
 			maskState: 0, //优惠券面板显示状态
-			desc: '', //备注
+			desc: '', //备注
+			payIntegral: 0,//总支付积分
 			payType: 1, //1微信 2支付宝
 			// 优惠券列表
 			couponList: [],
@@ -291,7 +297,8 @@ export default {
 					this.payType = true;
 					this.integralShow = true;
 					// 获取支付金额
-					this.payPrice = +data.result.pay_price;
+					this.payPrice = +data.result.pay_price;
+					this.payIntegral = +data.result.int;
 					this.integralMoney = data.result.deduction_price;
 				})
 				.catch(e => {
@@ -309,15 +316,6 @@ export default {
 			this.couponChecked = item;
 			this.payMoneyNub();
 		},
-		// 加载优惠券列表
-		couponsOrder(money) {
-			couponsOrder({}, money).then(e => {
-				if (e.data.length > 0) {
-					this.couponListshow = true;
-				}
-				this.couponList = e.data;
-			});
-		},
 		//顶部tab点击
 		tabClick(index) {
 			this.tabCurrentIndex = index;

+ 3 - 2
pages/order/order1.vue

@@ -36,7 +36,7 @@
 							<view class="right">
 								<view class="flex-start">
 									<text class="title clamp">{{ goodsItem.productInfo.store_name }}</text>
-									<text class="price">{{ goodsItem.productInfo.price|moneyNum }}</text>
+									<text class="price">{{ moneyNum(goodsItem.productInfo.price) }}</text>
 								</view>
 								<view class="row flex">
 									<text class="row_title">{{ goodsItem.productInfo.attrInfo ? goodsItem.productInfo.attrInfo.suk : '' }}</text>
@@ -51,7 +51,8 @@
 							件商品 邮费
 							<text class="price">{{ moneyNum(item.pay_postage)}}</text>
 							实付款
-							<text class="price">{{ moneyNum(item.pay_price)}}</text>
+							<text class="price" v-if="item.use_integral != 0">{{ moneyNum(item.pay_price)}}+{{item.use_integral}}趣豆</text>
+							<text class="price" v-if="item.use_integral == 0">{{ moneyNum(item.pay_price)}}</text>
 						</view>
 						<view class="action-box b-t" v-if="item.status != 5">
 							<button v-if="item._status._title == '未支付'" class="action-btn" @click.stop="cancelOrder(item)">取消订单</button>

+ 3 - 3
pages/order/orderDetail.vue

@@ -68,8 +68,8 @@
 			<view class="input">-¥{{ item.coupon_price }}</view>
 		</view>
 		<view class="row b-b flex" v-if="item.use_integral > 0">
-			<text class="tit">积分抵扣</text>
-			<view class="input">-¥{{ item.use_integral }}</view>
+			<text class="tit">趣豆</text>
+			<view class="input">{{ item.use_integral }}</view>
 		</view>
 		<view class="row b-b flex">
 			<text class="tit ">实付</text>
@@ -182,7 +182,7 @@ export default {
 	// #ifdef APP-PLUS || H5
 	onBackPress(e){
 		uni.navigateTo({
-			url: '/pages/order/order?state='+this.item._status._type
+			url: '/pages/order/order1?state='+this.item._status._type
 		});
 		return true;  
 	},

+ 1 - 1
pages/order/orderRefund.vue

@@ -88,6 +88,7 @@ export default {
 		},
 		//提交
 		confirm() {
+			let obj = this;
 			if (!obj.refund) {
 				uni.showModal({
 					title: '错误',
@@ -96,7 +97,6 @@ export default {
 				});
 				return false;
 			}
-			let obj = this;
 			refund({
 				text: obj.refund,
 				uni: obj.orderId,

+ 60 - 10
pages/product/product.vue

@@ -183,7 +183,8 @@
 // import share from '@/components/share';
 import uniNumberBox from '@/components/uni-number-box.vue';
 import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
-import { goodsDetail, cartAdd, collectAdd, collectDel, seckillGoods, groupGoods } from '@/api/product.js';
+import { goodsDetail, cartAdd, collectAdd, collectDel, seckillGoods, groupGoods } from '@/api/product.js';
+import { timeComputed } from '@/utils/rocessor.js';
 // #ifdef H5
 import { weixindata,shareLoad } from '@/utils/wxAuthorized';
 import { mapState } from 'vuex';
@@ -276,15 +277,64 @@ export default {
 			// 获取当前时间
 			let acitonTime = new Date();
 			// 判断当前时间是否大于结束时间
-			if (acitonTime.getTime() > stoptime) {
-				// 当前秒杀时间已经结束
-				this.seckillObj.stop = true;
-			} else {
-				// 计算倒计时
-				this.timeComputed(stoptime, this.seckillObj);
-			}
-			this.seckillGoods();
-			return;
+			seckillGoods({}, this.goodsid).then(({ data }) => {
+				obj.list = data;
+				console.log(obj.list, '秒杀商品数据++++++++++');
+				// obj.good_list = data.good_list; //保存猜你喜欢列表
+				obj.reply = data.reply; //保存评论列表
+				let goods = data.storeInfo;
+				obj.goodsNumberMax = goods.num;
+				// console.log('obj.goodsNumberMin+++++++++',obj.goodsNumberMin)
+				console.log(goods.stop_time,"时间")
+				const time = timeComputed(goods.stop_time);
+				obj.seckillObj = {
+					stop: time.tpye, //是否结束
+					stopTimeH: time.hours, //小时
+					stopTimeM: time.minutes, //分钟
+					stopTimeS: time.seconds //秒钟
+				};
+			
+				console.log(obj.seckillObj, '数据');
+				// console.log(obj.seckillObj,'obj.seckillObj++++++++++++++++++++++')
+				obj.goodsObjact = goods;
+				if (obj.goodsObjact.description != null) {
+					obj.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
+				} //小程序商品详情图超出屏幕问题
+				obj.imgList = goods.images; //保存轮播图
+				obj.specList = data.productAttr; //保存分类列表
+				if (Array.isArray(data.productValue) != true) {
+					console.log('多规格+++++++++++++');
+					obj.many = 2;
+					obj.specList = data.productAttr; //保存产品属性
+					obj.productValue = data.productValue; //保存属性值
+					obj.specSelected = []; //初始化默认选择对象
+					for (let i = 0; i < obj.specList.length; i++) {
+						// 设置默认数据
+						let attrValue = obj.specList[i].attr_value[0];
+						attrValue.check = true;
+						obj.specSelected.push(attrValue.attr);
+					}
+					let str = obj.specSelected.join(',');
+					console.log(str, 'str');
+					// 设置默认值
+					obj.actionPrice = obj.productValue[str].price;
+					// obj.goodsNumberMax = obj.productValue[str].quota;
+					// console.log(obj.goodsNumberMax,'obj.goodsNumberMax++++++++++++')
+					obj.actionImage = obj.productValue[str].image;
+					obj.uniqueId = obj.productValue[str].unique;
+					obj.goodsStore = obj.productValue[str].stock;
+				} else {
+					console.log('单规格+++++++++++++');
+					obj.many = 1;
+					obj.productValue = data.productValue; //保存分类查询数据
+					obj.actionPrice = goods.price; //保存默认选中商品价格
+					obj.actionImage = goods.image_base; //保存默认选中商品图片
+					// obj.goodsNumberMax = goods.quota; //保存默认选中最大可购买商品数量
+					console.log(obj.goodsNumberMax, 'obj.goodsNumberMax---------------');
+					obj.shopId = data.mer_id; //保存商店id
+				}
+			});
+			
 		}
 		if (options.type == 2) {
 			// 保存当前拼团商品类型

+ 20 - 5
pages/user/myAppointment.vue

@@ -11,10 +11,15 @@
 				<view class="money">{{ userInfo.anticipate }}</view>
 				<view>余额</view>
 			</view>
-			<view class="money-btn" @click="navto('/pages/money/wallet')">
-				转账
-				<text>></text>
+			<view class="moneybtn-box">
+				<view class="money-btn" @click="navto('/pages/money/wallet')">
+					转账
+				</view>
+				<view class="money-btn" @click="navto('/pages/money/recharge?status=2')">
+					充值
+				</view>
 			</view>
+			
 		</view>
 		<view class="info-box flex">
 			<view class="info-item">
@@ -283,6 +288,18 @@ page {
 		background: #dcdfe6;
 	}
 }
+.moneybtn-box {
+	display: flex;
+	justify-content: space-between;
+	position: relative;
+	z-index: 2;
+	color: #ffffff;
+	padding:20rpx 50rpx ;
+	font-size: 30rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #FFFFFF;
+}
 .money-box {
 	position: relative;
 	z-index: 2;
@@ -303,7 +320,6 @@ page {
 	position: relative;
 	z-index: 2;
 	color: #ffffff;
-	padding-right: 50rpx;
 	text-align: right;
 	font-size: 30rpx;
 	font-family: PingFang SC;
@@ -407,7 +423,6 @@ page {
 	position: relative;
 	z-index: 2;
 	color: #ffffff;
-	padding-right: 50rpx;
 	text-align: right;
 	font-size: 30rpx;
 	font-family: PingFang SC;

+ 1 - 1
pages/user/myyue.vue

@@ -8,7 +8,7 @@
 			</view>
 			<view class="content-bg"><image src="../../static/img/jifen.png" mode=""></image></view>
 			<view class="money-box">
-				<view class="money">{{ userInfo.brokerage_price }}</view>
+				<view class="money">{{ userInfo.now_money }}</view>
 				<view>我的余额</view>
 			</view>
 			<view class="money-btn" @click="navto('/pages/money/recharge')">

+ 1 - 1
pages/user/user.vue

@@ -24,7 +24,7 @@
 				<view class="jg"></view>
 				<view class="sy-item" @click="navTo('/pages/user/myyue')">
 					<view class="sy-item-val">
-						<!-- {{ userInfo.brokerage_price }} -->{{userInfo.now_money}}
+						{{userInfo.now_money}}
 					</view>
 					<view class="sy-item-name">
 						我的余额