lyy@qq.com 11 달 전
부모
커밋
e079cf93d0

+ 11 - 4
components/specPopup.vue

@@ -30,6 +30,7 @@
 			<view class="btn reset" @click="toShop">加入购物车</view>
 			<view class="btn confirm" @click="toBuy">立即购买</view>
 		</view>
+		<u-toast ref="uToast"></u-toast>
 	</uni-popup>
 </template>
 
@@ -201,10 +202,16 @@
 						// 请求成功
 						if (response.code == 200) {
 							// 弹出消息
-							uni.showToast({
-								title: '加入购物车成功',
-								icon: 'success',
-								duration: 2000
+							// uni.showToast({
+							// 	title: '加入购物车成功',
+							// 	icon: 'success',
+							// 	duration: 2000
+							// })
+							this.$refs.uToast.show({
+								type: 'success',
+								title: '默认主题',
+								message: "加入购物车成功",
+								position: 'center'
 							})
 							this.$emit('addShop');
 						} else if (response.code == 500) {

+ 2 - 2
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "yx_wx_applet",
-    "appid" : "__UNI__8DC0664",
+    "appid" : "__UNI__A586034",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",
@@ -50,7 +50,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wxfa70687fbaeb7894",
+        "appid": "wxfc1ae62fd810717d",
         "setting" : {
             "urlCheck" : false
         },

+ 5 - 5
pages.json

@@ -1,16 +1,16 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-			"path": "pages/classify/classify",
+			"path": "pages/login/login",
 			"style": {
-				"navigationBarTitleText": "首页",
-				"enablePullDownRefresh": false
+				"navigationBarTitleText": "登录"
 			}
 		},
 		{
-			"path": "pages/login/login",
+			"path": "pages/classify/classify",
 			"style": {
-				"navigationBarTitleText": "登录"
+				"navigationBarTitleText": "首页",
+				"enablePullDownRefresh": false
 			}
 		},
 		{

+ 22 - 17
pages/classify/classify.vue

@@ -95,17 +95,20 @@
 			}
 		},
 		onLoad() {
-			const e = uni.getStorageSync('carl')
-			this.cList = e
-			this.fatchDate()
-			this.carListMeg()
-			uni.$on('register_refresh', () => {
+			const token = uni.getStorageSync('token')
+			if (token) {
+				const e = uni.getStorageSync('carl')
+				this.cList = e
 				this.fatchDate()
 				this.carListMeg()
-				this.total = 0
-			})
-			const token = uni.getStorageSync('token')
-			if (!token) {
+				this.tables()
+				uni.$on('register_refresh', () => {
+					this.fatchDate()
+					this.carListMeg()
+					this.tables()
+					this.total = 0
+				})
+			} else {
 				this.modalShow = true;
 			}
 		},
@@ -229,14 +232,6 @@
 					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`, {
@@ -246,6 +241,16 @@
 					const carList = res.data
 					this.buyCount = carList.length
 				}
+			},
+			async tables() {
+				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
+				}
 			}
 		}
 	}

+ 15 - 8
pages/goodDetail/goodDetail.vue

@@ -88,6 +88,7 @@
 		<use-totop ref="usetop" bottom="120"></use-totop>
 		<specPopup ref="specPopup" :cardMsg="cardMsg" @seChanged="seChanged" @addShop="carListMeg"></specPopup>
 		<cartPopupVue ref="cartPopup" @selected-changed="handleSelectedChanged" />
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -119,7 +120,7 @@
 				scrollTop: 0,
 				count: 1,
 				dataDel: {},
-				toList:[]
+				toList: []
 			}
 		},
 		onLoad(option) {
@@ -186,10 +187,16 @@
 					console.log('response', response)
 					if (response.code = 200) {
 						// 弹出消息
-						uni.showToast({
-							title: '加入购物车成功',
-							icon: 'success',
-							duration: 2000
+						// uni.showToast({
+						// 	title: '加入购物车成功',
+						// 	icon: 'success',
+						// 	duration: 2000
+						// })
+						this.$refs.uToast.show({
+							type: 'success',
+							title: '默认主题',
+							message: "加入购物车成功",
+							position: 'center'
 						})
 						this.carListMeg()
 					} else if (response.code = 500) {
@@ -225,10 +232,10 @@
 			},
 			//根据skuid获取选择商品信息
 			async seChanged(e) {
-				console.log('==================3e', e)
+				// console.log('==================3e', e)
 				this.specValue = e.item
 				this.count = e.count
-				const res = await this.$request('get', `/item/sku/${e.id}`)
+				const res = await this.$request('get', `/item/sku/queryItem/${e.id}`)
 				this.detailMsg = res.data
 				console.log('this.detailMsg', this.detailMsg)
 			},
@@ -254,7 +261,7 @@
 				let priceInCents = Math.round(toList.price * 100);
 				let quant = toList.quantity;
 				total += priceInCents * quant;
-				
+
 				this.toList.push(toList)
 				// 将总价格转换回浮点数(以元为单位)
 				this.total = (total / 100).toFixed(2);

+ 21 - 7
pages/order/myOrder/myOrder.vue

@@ -17,10 +17,13 @@
 				<!-- 滚动区 -->
 				<scroll-view class="h-full" scroll-y @scrolltolower="loadData">
 					<!-- 空白页 -->
-					<u-empty text="订单是空的~"
-						v-if="!tabItem.loaded && (!tabItem.orderList || tabItem.orderList.length === 0)" mode="order"
-						style="padding-top: 100rpx;">
-					</u-empty>
+					<view v-if="!tabItem.loaded && (!tabItem.orderList || tabItem.orderList.length === 0)"
+						class="emptys">
+						<u-empty text="订单是空的~"
+							v-if="!tabItem.loaded && (!tabItem.orderList || tabItem.orderList.length === 0)"
+							mode="order">
+						</u-empty>
+					</view>
 					<!-- 订单列表区 -->
 					<view class="margin-bottom-sm" :class="index === 0 ? 'padding-top-sm' : ''"
 						v-for="(item, index) in tabItem.orderList" :key="index">
@@ -35,8 +38,8 @@
 										订单编号:{{ item.orderId }}
 									</view>
 									<text class="fs-xs active">
-										<text v-if="item.status == 'TRADE_NO_CREATE_PAY'">待付款</text>
-										<text v-else>已完成</text>
+										<text v-if="item.orderState == '1'">待付款</text>
+										<text v-else-if="item.orderState == '6'">已完成</text>
 									</text>
 								</view>
 								<!-- 订单商品明细 -->
@@ -183,7 +186,10 @@
 					console.log('result', result.rows)
 					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');
+					this.navList[1].orderList = result.rows.filter(item => item.orderState == '1')
+					this.navList[2].orderList = result.rows.filter(item => item.orderState == '3')
+					this.navList[3].orderList = result.rows.filter(item => item.orderState == '8')
+					this.navList[4].orderList = result.rows.filter(item => item.orderState == '6')
 				}
 			},
 			loadData() {},
@@ -281,6 +287,14 @@
 		background: $page-color-base;
 	}
 
+	.emptys {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		height: 100%;
+	}
+
 	/* 订单状态区 */
 	.navbar-area {
 		white-space: nowrap;

+ 1 - 1
pages/order/orderPaid/orderPaid.vue

@@ -6,7 +6,7 @@
 				<view class="state-info">待支付 </view>
 				<view class="order-code">剩余 09:59 逾期未支付将自动取消</view>
 			</view>
-			<uni-icons type="right" size="24" color="#FFF"></uni-icons>
+			<!-- <uni-icons type="right" size="24" color="#FFF"></uni-icons> -->
 		</view>
 		<view class="gap"></view>
 		<view class="padding-sm dflex-b bg-main" @click="show = true">

+ 22 - 3
pages/user/user.vue

@@ -36,8 +36,10 @@
 						</u-row>
 						<view class="flex-box mt20px">
 							<view class="flex-box-item" @click="openPage('/pages/order/myOrder/myOrder?type=1')">
-								<u-icon name="rmb-circle" labelColor="#96989e" labelPos="bottom" labelSize="14px"
-									label="待付款" size="40"></u-icon>
+								<uni-badge size="normal" :text="txts" absolute="rightTop">
+									<u-icon name="rmb-circle" labelColor="#96989e" labelPos="bottom" labelSize="14px"
+										label="待付款" size="40"></u-icon>
+								</uni-badge>
 							</view>
 							<view class="flex-box-item" @click="openPage('/pages/order/myOrder/myOrder?type=2')">
 								<u-icon name="clock" labelColor="#96989e" label="待核销" labelSize="14px" labelPos="bottom"
@@ -93,13 +95,15 @@
 				},
 				src: iAvg,
 				cPhone: '',
-				cList: {}
+				cList: {},
+				txts: 1
 			}
 		},
 		onLoad() {
 			const e = uni.getStorageSync('info')
 			this.cPhone = e
 			this.fatchDate()
+			this.tables()
 
 			const q = uni.getStorageSync('carl')
 			this.cList = q
@@ -110,6 +114,7 @@
 					url: path
 				})
 			},
+			
 			fatchDate() {
 				wx.getUserInfo({
 					success: (res) => {
@@ -119,6 +124,20 @@
 					}
 				})
 			},
+			async tables() {
+				const q = uni.getStorageSync('carl')
+				const params = {
+					storeId: q.id
+				}
+				const res = await this.$request('get', '/order/tradeOrder/queryTradeOrder', params)
+				if (res) {
+					console.log('result11111111111111111', res.rows)
+					const l = res.rows.filter(item => item.orderState == '1')
+					console.log('==========', l)
+					this.txts = l.length
+					// 目前仅弄了待付款的
+				}
+			},
 			call() {
 				console.log('eeeeeeeeeeeeeeee===============', this.cPhone)
 				if (this.cPhone.customerPhone) {

BIN
static/avg.png


BIN
static/banner1.jpg


BIN
static/banner2.png


BIN
static/dangq.png


BIN
static/nice.jpg


BIN
static/x0.jpg


BIN
static/x1.jpg