浏览代码

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

chenrui 4 年之前
父节点
当前提交
0fcfadeb8f

+ 9 - 2
components/uni-coods/uni-coods.vue

@@ -3,7 +3,14 @@
 		<view class="goods-item" v-for="item in list" :key="item.id">
 			<view class="goods-imgs"  @click="toDetail(item)">
 				<view v-if="item.inventoryQty == 0" class="goods-staus">已售罄</view>
-				<u-lazy-load img-mode="scaleToFill" :height="imgHeight" :image="item.homeImage" :loading-img="loadingImg" :error-img="errorImg"></u-lazy-load>
+				<view v-if="item.delFlage == 0 || item.state == 0" class="goods-staus">已失效</view>
+				<u-lazy-load 
+				img-mode="scaleToFill" 
+				:height="imgHeight" 
+				:image="item.homeImage+'?x-oss-process=image/resize,m_pad,h_252,w_325,color_ffffff'" 
+				:loading-img="loadingImg" 
+				:error-img="errorImg">
+				</u-lazy-load>
 			</view>
 			<view class="name ellipsis-two"  @click="toDetail(item)">{{item.name}}</view>
 			<view class="price">
@@ -11,7 +18,7 @@
 					<text>{{item.sellGold}}</text>
 					<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
 				</view>
-				<view @click.stop="addCart(item)" v-if="item.inventoryQty > 0">
+				<view @click="addCart(item)" v-if="item.inventoryQty > 0">
 					<u-image mode="scaleToFill" width="45rpx" height="45rpx" src="/static/addCart.png"></u-image>
 				</view>
 			</view>

+ 8 - 7
components/uni-number-box/uni-number-box.vue → components/uni-numbers-box/uni-numbers-box.vue

@@ -11,8 +11,12 @@
 </template>
 <script>
 	export default {
-		name: "UniNumberBox",
+		name: "UniNumbersBox",
 		props: {
+			index:{
+				type: String,
+				default: ''
+			},
 			value: {
 				type: [Number, String],
 				default: 1
@@ -36,21 +40,18 @@
 		},
 		data() {
 			return {
-				inputValue: 0
+				inputValue: this.value
 			};
 		},
 		watch: {
 			value(newVal,oldVal) {
 				console.log(newVal,oldVal,'000')
 				this.inputValue = +newVal;
-				if (+newVal !== +oldVal) {
-					this.$emit("change", newVal);
-				}
 			},
 			inputValue(newVal, oldVal) {
-				console.log(newVal,oldVal,'111')
+				console.log(newVal,oldVal,this.index,'111')
 				if (+newVal !== +oldVal) {
-					// this.$emit("change", newVal);
+					this.$emit("change", newVal, this.index);
 				}
 			}
 		},

+ 3 - 3
pages.json

@@ -19,8 +19,8 @@
 		{
 			"path": "pages/goods/index", // 商城
 			"style": {
-				"navigationBarTitleText": "乐色管家",
-				"enablePullDownRefresh": false
+				"navigationBarTitleText": "乐色商城",
+				"enablePullDownRefresh": true
 			}
 		},
 		{
@@ -150,7 +150,7 @@
             "style" :                                                                                    
             {
                 "navigationBarTitleText": "商品",
-                "enablePullDownRefresh": false
+                "enablePullDownRefresh": true
             }
             
         },

+ 143 - 124
pages/cart/cart.vue

@@ -11,19 +11,19 @@
 			<!-- 按分类显示 -->
 			<view class="goods-class-box" v-for="(item,cindex) in cartList" :key="item.goodsTypeNo">
 				<view class="goods-class-head">
-					<view>
-						<u-checkbox 
-						shape="circle" 
-						v-model="item.checked" 
-						active-color="#01c9b2" 
-						:name='item.goodsTypeNo' 
-						size="40rpx"
-						@change="goodsClasChange">
+					<view @click="goodsClasChange(cindex)">
+						<view 
+						class="check-button" 
+						v-if="isSxGoodAll(item).length||isEdit"
+						:class="item.checked?'checked':'uncheck'">
+						</view>
+						<view v-else class="check-button disabled"></view>
+						<view class="goodClsName">
 							{{item.name}}
-						</u-checkbox>
+						</view>
 					</view>
 					<view class="des">
-						<view>商品乐豆合计满<text>{{item.goldLimit}}</text></view>
+						<view>商品满<text>{{item.goldLimit}}</text></view>
 						<u-image mode="scaleToFill" width="26rpx" height="26rpx" src="/static/ledou.png"></u-image>
 						<view>才可购买</view>
 					</view>
@@ -31,24 +31,21 @@
 				<view class="goods-class-list">
 					<!-- 商品列表 -->
 					<view class="goods-item" v-for="(good,index) in item.shoppingCartGoodsList" :key="good.id">
-						<view class="checkbox">
-							<u-checkbox 
-							v-model="good.checked" 
-							v-if="good.goods.inventoryQty>0||isEdit" 
-							shape="circle" 
-							active-color="#01c9b2" 
-							size="40rpx"
-							:name='good.id+"-"+cindex'
-							@change="goodsChange"
-							></u-checkbox>
+						<view class="checkbox" 
+						   @click="goodsChange(good,index,cindex)">
+							<view
+							class="check-button" 
+							v-if="isSxGood(good)||isEdit"
+							:class="good.checked?'checked':'uncheck'">
+							</view>
+							<view v-else class="check-button disabled"></view>
 						</view>
 						<view class="goods-info">
 							<view class="goods-imgs">
-								<view v-if="good.goods.inventoryQty==0||good.goods.state == 0" class="goods-staus">
-									<text v-if="good.goods.inventoryQty==0">已售罄</text>
-									<text v-if="good.goods.state == 0">已下架</text>
+								<view v-if="good.goods.inventoryQty==0||good.goods.state == 0||good.goods.delFlage == 0" class="goods-staus">
+									<text>已失效</text>
 								</view>
-								<u-image border-radius="12" width="158rpx" height="140rpx" :src="good.goods.homeImage"></u-image>
+								<u-image border-radius="12" width="158rpx" height="140rpx" :src="good.goods.homeImage+'?x-oss-process=image/resize,m_pad,h_252,w_325,color_ffffff'"></u-image>
 							</view>
 							<view class="goods-text">
 								<view class="good-name">{{good.goods.name}}</view>
@@ -57,9 +54,11 @@
 										<text>{{good.goods.sellGold}}</text>
 										<u-image mode="scaleToFill" width="30rpx" height="30rpx" src="/static/ledou.png"></u-image>
 									</view>
-									<view v-if="good.goods.inventoryQty>0">
-										<!-- <u-number-box @change="goodsNumsChange(good,cindex)" :index="index+'-'+cindex" :min="1" v-model="good.buyQty"></u-number-box> -->
-										<uni-number-box @change="goodsNumsChange(good,cindex)" v-model="good.buyQty" :min="1"></uni-number-box>
+									<view v-if="good.goods.inventoryQty>0&&good.goods.state==1">
+										<uni-numbers-box @change="goodsNumsChange()" :index="cindex+'-'+index" :value="good.buyQty" :min="1"></uni-numbers-box>
+									</view>
+									<view v-else>
+										<view style="width: 100rpx;text-align: center;">×{{good.buyQty}}</view>
 									</view>
 								</view>
 							</view>
@@ -67,7 +66,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="noData" v-if="cartList.length==0">
+			<view class="noData" v-if="!loading&&cartList.length==0">
 				<u-empty mode="car">
 					<view slot="bottom">
 						<u-button size="mini" @click="toBuy">去选商品</u-button>
@@ -76,16 +75,14 @@
 			</view>
 		</view>
 		<view class="cart-submit" v-if="cartList.length>0">
-			<view>
-				<u-checkbox 
-				shape="circle" 
-				name='checkAll' 
-				size="40rpx"
-				active-color="#01c9b2" 
-				@change="checkAllChange" 
-				v-model="checkAll">
-				{{checkAll?'取消':'全选'}}
-				</u-checkbox>
+			<view @click="checkAllChange()">
+				<view 
+				class="check-button" 
+				:class="checkAll?'checked':'uncheck'">
+				</view>
+				<view class="checkAll">
+					{{checkAll?'取消':'全选'}}
+				</view>
 			</view>
 			<view v-if="!isEdit">
 				<view class="heji">
@@ -102,9 +99,7 @@
 </template>
 
 <script>
-	import uniNumberBox from "@/components/uni-number-box/uni-number-box.vue"
 	export default {
-		components: {uniNumberBox},
 		data() {
 			return {
 				toOrderButton: {
@@ -115,12 +110,14 @@
 				},
 				checkAll: false,// 全选
 				isEdit: false, // 是否编辑模式
+				cartList: [], // 商品列表
+				loading: false
 			};
 		},
 		computed: {
 			// 总数
 			count() {
-				let arr = this.$store.state.vuex_cartList
+				let arr = this.cartList
 				let count = 0
 				arr.map(item=>{
 					count = count + item.shoppingCartGoodsList.length
@@ -148,14 +145,21 @@
 				})
 				return total
 			},
-			// 商品列表
-			cartList(){
-				return this.$store.state.vuex_cartList
-			}
 		},
-		onShow() {
+		onLoad() {
+			this.loading = true
 			uni.$emit('getCartList')
-			this.hasCheckAll()
+			// 刷新列表成功
+			uni.$on('getCarListSuccess',item => {
+				this.cartList = JSON.parse(JSON.stringify(this.$store.state.vuex_cartList))
+				this.loading = false
+				// 默认全选
+				if(!this.isEdit){
+					this.checkAllChange()
+				}
+			})
+		},
+		onShow() {
 		},
 		methods: {
 			toBuy(){
@@ -176,17 +180,6 @@
 				})
 				return goods
 			},
-			// 全选 或 取消全选
-			checkAllChange(e) {
-				let arr = this.cartList
-				arr.map(item=>{
-					item.checked = e.value
-					item.shoppingCartGoodsList.map(goods=>{
-						goods.checked =  e.value
-					})
-				})
-				arr.splice()
-			},
 			// 判断当前分类下的商品总和是否满足规则
 			hasZgjindu(item){
 				let ret = 0
@@ -197,66 +190,70 @@
 				console.log(ret , goldLimit)
 				return !this.isEdit ? ret >= goldLimit : true
 			},
+			// 设置每个分类下的商品选中状态
+			setClsGoodStatus(item,checked){
+				console.log(checked)
+				item.shoppingCartGoodsList.map(good=>{
+					// 已下架,已删除,已销完的不选
+					if((good.goods.inventoryQty==0||good.goods.state == 0||good.goods.delFlage == 0) && !this.isEdit){
+						good.checked = false
+					}else{
+						good.checked = checked
+					}
+				})
+			},
+			// 全选 或 取消全选
+			checkAllChange() {
+				let arr = this.cartList
+				arr.map(item=>{
+					item.checked = !this.checkAll
+					this.setClsGoodStatus(item,!this.checkAll)
+				})
+				this.checkAll = !this.checkAll
+				arr.splice()
+			},
 			// 每个分类的全选
-			goodsClasChange(e){
-				console.log(e);
-				let index = this.cartList.findIndex(item => item.goodsTypeNo == e.name)
+			goodsClasChange(index){
 				let item = this.cartList[index]
-				if(this.hasZgjindu(item)){
-					item.checked = e.value
-					item.shoppingCartGoodsList.map(goods=>{
-						goods.checked = e.value
-					})
-					// 判断是否全选
-					this.hasCheckAll()
-				}else{
-					setTimeout(()=>{
-						item.checked = false
-						this.cartList.splice()
-					},100)
-					uni.showToast({
-						icon: 'none',
-						title: '此分类的商品乐豆合计需要满'+item.goldLimit+'乐豆才可以购买'
-					})
-				}
+				item.checked = !item.checked
+				this.setClsGoodStatus(item,item.checked)
+				// 判断是否全选
+				this.hasCheckAll()
 			},
 			// 商品选择
-			goodsChange(e){
-				console.log(e)
-				let a = e.name.split('-')
-				let row = this.cartList[a[1]]
-				let goodsIndex = row.shoppingCartGoodsList.findIndex(item => item.id == a[0])
-				if(this.hasZgjindu(row)){
-					row.shoppingCartGoodsList[goodsIndex].checked = e.value
-					// 判断当前分类是否全选
-					this.clasGoodsHasCheckAll(a[1])
-					// 判断是否全选
-					this.hasCheckAll()
-				}else{
-					setTimeout(()=>{
-						row.checked = false
-						row.shoppingCartGoodsList[goodsIndex].checked = false
-						this.cartList.splice()
-					},100)
-					uni.showToast({
-						icon: 'none',
-						title: '此分类的商品乐豆合计需要满'+row.goldLimit+'乐豆才可以购买'
-					})
-				}
+			goodsChange(good,index,cindex){
+				let goods = this.cartList[cindex] // 当前分类
+				good.checked = !good.checked
+				// 判断当前分类是否全选
+				this.clasGoodsHasCheckAll(goods)
+			},
+			// 判断某个商品是否失效
+			isSxGood(item){
+				return !(item.goods.inventoryQty==0||item.goods.state == 0||item.goods.delFlage == 0) || this.isEdit
+			},
+			// 判断分类下商品是否都是已失效
+			isSxGoodAll(row){
+				return row.shoppingCartGoodsList.filter(item => {
+					return this.isSxGood(item)
+				})
 			},
 			// 判断某个分类是否全选
-			clasGoodsHasCheckAll(index){
-				let row = this.cartList[index]
-				let len = row.shoppingCartGoodsList.length
+			clasGoodsHasCheckAll(row){
+				let goods = this.isSxGoodAll(row)
+				let len = goods.length
 				let clen = 0
-				row.shoppingCartGoodsList.map(item=>{
-					console.log(item.checked)
+				if(len==0){
+					return
+				}
+				goods.map(item=>{
 					if(item.checked){
 						clen = clen + 1
 					}
 				})
 				row.checked = clen == len
 				this.cartList.splice()
+				// 判断是否全选
+				this.hasCheckAll()
 			},
 			// 是否全选
 			hasCheckAll(){
@@ -274,8 +271,8 @@
 			// 编辑购物车
 			editCart(){
 				this.isEdit = !this.isEdit
-				this.checkAllChange({value:false})
-				this.checkAll = false
+				this.checkAll = true
+				this.checkAllChange()
 			},
 			// 立即下单
 			toOrder(){
@@ -306,22 +303,14 @@
 				}
 			},
 			// 更改商品数量
-			goodsNumsChange(e,cindex){
-				console.log(e,cindex)
+			goodsNumsChange(val,id){
+				console.log(val,id)
+				let cindex = id.split('-')[0]
+				let index = id.split('-')[1]
 				let item = this.cartList[cindex]
-				console.log(item)
-				let row = item.shoppingCartGoodsList.find(k=> k.id == e.id)
-				if(this.hasZgjindu(item)){
-					uni.$emit("updateGoodsBuyQty",{id:e.id,buyQty:e.buyQty})
-				}else{
-					item.checked = false
-					row.checked = false
-					this.cartList.splice()
-					uni.showToast({
-						icon: 'none',
-						title: '此分类的商品乐豆合计需要满'+item.goldLimit+'乐豆才可以购买'
-					})
-				}
+				let row = item.shoppingCartGoodsList[index]
+				row.buyQty = val
+				uni.$emit("updateGoodsBuyQty",{id:row.id,buyQty:row.buyQty})
 			}
 		},
 	}
@@ -355,6 +344,23 @@ page{
 			margin: 0 10rpx;
 		}
 	}
+	.check-button{
+		width: 40rpx;
+		height: 40rpx;
+	}
+	.checked{
+		background: url('/static/checked.png') no-repeat center center;
+		background-size: 100% 100%;
+	}
+	.uncheck{
+		background: url('/static/uncheck.png') no-repeat center center;
+		background-size: 100% 100%;
+	}
+	.disabled{
+		border:2rpx solid #EEEEEE;
+		border-radius: 100rpx;
+		background: #F8F8F8;
+	}
 	.goods-list{
 		flex-grow: 1;
 		overflow: auto;
@@ -368,6 +374,16 @@ page{
 				padding: 20upx;
 				border-bottom: 1px solid #F8F8F8;
 				justify-content: space-between;
+				> view{
+					&:first-child{
+						display: flex;
+						align-items: center;
+					}
+					.goodClsName{
+						font-size: 30rpx;
+						margin-left: 10rpx;
+					}
+				}
 				.des{
 					display: flex;
 					align-items: center;
@@ -453,9 +469,12 @@ page{
 		align-items: center;
 		justify-content: space-between;
 		>view{
+			display: flex;
+			align-items: center;
+			.checkAll{
+				margin-left: 10rpx;
+			}
 			&:last-child{
-				display: flex;
-				align-items: center;
 				font-size: 26upx;
 				text{
 					color: red;

+ 2 - 2
pages/checkOut/checkFinish.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="page-cont">
 		<view class="icon-cont">
-			<u-icon class="icon" name="checkmark" color="#62c500" size="80"></u-icon>
+			<u-icon class="icon" name="checkmark" color="#ffffff" size="80"></u-icon>
 			<view>支付成功</view>
 			<view>150 乐豆</view>
 		</view>
@@ -63,7 +63,7 @@ export default {
 		.icon{
 			width: 120upx;
 			height: 120upx;
-			background-color: #d1d1d1;
+			background-color: #00aa00;
 			display: flex;
 			justify-content: center;
 			border-radius: 50%;

+ 6 - 7
pages/checkOut/checkOut.vue

@@ -14,7 +14,8 @@
 			label="备注"
 			input-align="right"
 			auto-height
-			placeholder="请填写备注(最多500个字符)"
+			:maxlength="10"
+			placeholder="请填写备注(最多10个字符)"
 			type="textarea"
 		>
 		</u-field>
@@ -50,8 +51,8 @@
 					</view>
 				</view>
 				<view class="footer">
-					<u-input v-model="password" 
-					input-align="center" 
+					<input v-model="password" 
+					style="text-align: center;" 
 					type="password" 
 					placeholder="请输入支付密码" 
 					:maxlength="30"
@@ -153,10 +154,8 @@
 				sellerReceive(data).then(res => {
 					console.log(res)
 					if(res.status == 200){
-						uni.navigateBack()
-						uni.showToast({
-							icon: 'none',
-							title: res.message
+						uni.redirectTo({
+							url:"/pages/checkOut/checkFinish"
 						})
 					}
 				})

+ 14 - 1
pages/goods/goods.vue

@@ -19,6 +19,7 @@
 			return {
 				clsId: '',
 				goldLimit:0,
+				goodsName: '',
 				pageNo: 1,
 				pageSize: 10,
 				goodsList:[],
@@ -27,11 +28,23 @@
 			};
 		},
 		onLoad(opts) {
-			console.log(opts)
+			this.goodsName = opts.name
 			this.clsId = opts.goodsTypeNo
 			this.goldLimit = opts.goldLimit
+			uni.setNavigationBarTitle({
+				title: this.goodsName
+			})
 			this.getGoods()
 		},
+		// 下拉刷新
+		onPullDownRefresh() {
+			console.log('refresh')
+			this.pageNo = 1
+			this.getGoods()
+			setTimeout(function () {
+				uni.stopPullDownRefresh()
+			}, 200)
+		},
 		methods: {
 			// 查询商品
 			getGoods(item,index){

+ 3 - 2
pages/goods/goodsDetail.vue

@@ -4,7 +4,7 @@
 			<!-- 商品信息 -->
 			<view class="goods-head">
 				<view class="goods-imgs">
-					<view class="goods-staus" v-if="goodContent.inventoryQty == 0"></view>
+					<view class="goods-staus" v-if="goodContent.inventoryQty == 0 || goodContent.delFlage == 0 || goodContent.state == 0"></view>
 					<u-swiper height="340" :border-radius="15" mode="number" indicator-pos="bottomRight" :list="imageList"></u-swiper>
 				</view>
 				<view class="goods-name">
@@ -103,7 +103,8 @@
 			},
 			// 立即下单
 			toOrder(){
-				this.$u.vuex("vuex_toOrderList",[{id:this.id,buyQty:this.nums,goods:this.goodContent}])
+				// console.log(this.goodContent,this.id,'pppppppp')
+				this.$u.vuex("vuex_toOrderList",[{id:this.id,buyQty:this.nums,goodsNo:this.goodContent.goodsNo,goods:this.goodContent}])
 				uni.redirectTo({
 					url:"/pages/toOrder/index"
 				})

+ 31 - 20
pages/goods/index.vue

@@ -6,7 +6,7 @@
 		</view>
 		<!-- 商品 -->
 		<view class="goods">
-			<view v-for="(item,index) in goodsList" :key="item.type.id" v-if="goodsList.length&&item.list.length">
+			<view v-for="(item,index) in goodsList" :key="index" v-if="goodsList.length&&item.list.length">
 				<u-section :title="item.type.name" font-size="35" line-color="#01c9b2" sub-title="更多" @click="toGoods(item.type)"></u-section>
 				<view class="goods-list">
 					<uni-coods :list="item.list"></uni-coods>
@@ -32,29 +32,40 @@
 		},
 		data() {
 			return {
-				noDataText: '正加载...',
+				noDataText: '正加载...',
 				imageTopList:[],
 				goodsList:[], // 商品
 				goodsType:[], // 商品分类
 			}
 		},
-		onShow() {
-			this.getbannerList()
-			this.goodsList = []
-			getGoodsClass({}).then(res => {
-				console.log(res)
-				if(res.status == 200){
-					this.goodsType = res.data
-					this.goodsType.map((item,index) => {
-						this.getGoods(item,index)
-					})
-				}else{
-					this.goodsList = []
-					this.noDataText = '暂无商品'
-				}
-			})
+		onLoad() {
+			this.pageInit()
+		},
+		// 下拉刷新
+		onPullDownRefresh() {
+			console.log('refresh')
+			this.pageInit()
+			setTimeout(function () {
+				uni.stopPullDownRefresh()
+			}, 200)
 		},
 		methods: { 
+			pageInit(){
+				this.getbannerList()
+				this.goodsList = []
+				getGoodsClass({}).then(res => {
+					console.log(res)
+					if(res.status == 200){
+						this.goodsType = res.data
+						this.goodsType.map((item,index) => {
+							this.getGoods(item,index)
+						})
+					}else{
+						this.goodsList = []
+						this.noDataText = '暂无商品'
+					}
+				})
+			},
 			// 点击banner
 			clickBanner(index){
 				let row = this.imageTopList[index]
@@ -83,7 +94,7 @@
 			// 更多商品
 			toGoods(item){
 				uni.navigateTo({
-					url:"/pages/goods/goods?goodsTypeNo="+ item.goodsTypeNo + "&goldLimit="+ item.goldLimit
+					url:"/pages/goods/goods?goodsTypeNo="+ item.goodsTypeNo + "&goldLimit="+ item.goldLimit + "&name=" + item.name
 				})
 			},
 			// 查询商品
@@ -91,10 +102,10 @@
 				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.push({
+						this.goodsList[index] = {
 							type: item,
 							list: res.data.list
-						})
+						}
 						this.goodsList.splice()
 					}
 				})

+ 9 - 0
pages/index/index.vue

@@ -106,6 +106,9 @@
 				this.getUserInfo(item)
 			})
 		},
+		onUnload() {
+			uni.$off('getCarListSuccess')
+		},
 		onShow() {
 			// 获取订单状态数据字典
 			this.getCodeList('RUBBISH_TYPE','vuex_rubbishType')
@@ -192,11 +195,16 @@
 					console.log(res)
 					if(res.status == 200){
 						this.$u.vuex('vuex_cartList', res.data)
+						uni.$emit('getCarListSuccess')
 					}
 				})
 			},
 			// 添加购物车
 			addGoodToCart(item){
+				uni.showLoading({
+					mask: true,
+					title: "加入购物车中..."
+				})
 				addGoodsToCart(item).then(res => {
 					if(res.status == 200){
 						uni.showToast({
@@ -206,6 +214,7 @@
 						// 刷新购物车
 						this.getCartList()
 					}
+					uni.hideLoading()
 				})
 			},
 			// 删除购物车

+ 18 - 16
pages/order/order.vue

@@ -41,7 +41,9 @@
 										<text style="margin-right: 20upx;">
 											支付剩余
 										</text>
-										<u-count-down @end="getRow" style="margin-right: 20upx;" separator ="zh" :timestamp="filterTime(item.orderTime)" :show-days="false" :show-hours="false"></u-count-down>
+										<u-count-down @end="getRow" 
+										style="margin-right: 20upx;" separator ="zh" 
+										:timestamp="item.leftTimeT" :show-days="false" :show-hours="false"></u-count-down>
 									<u-button :custom-style="btnStyle" @click="toPay(item)"  shape="circle" type="error" size="medium">去支付</u-button>
 								</view>
 								<view v-if="item.orderState=='WAIT_SEND'||item.orderState=='SEND_PART'" class="text-right">
@@ -93,8 +95,9 @@
 					<text class="num-big">{{totalPrice}}</text>乐豆
 				</view>
 				<view class="footer">
-					<u-input v-model="password" maxlength="30" 
-					input-align="center" type="password" 
+					<input v-model="password" maxlength="30" 
+					style="text-align: center;"
+				    type="password" 
 					placeholder="请输入支付密码" 
 					@confirm="toPayOrder"/>
 				</view>
@@ -223,10 +226,12 @@
 					this.pageNo += 1
 					this.getRow()
 				} else {
-					uni.showToast({
-						title: '已经到底了',
-						icon: 'none'
-					});
+					if(this.list.length) {
+						uni.showToast({
+							title: '已经到底了',
+							icon: 'none'
+						});
+					}
 					this.status = "nomore"
 				}
 			},
@@ -250,6 +255,12 @@
 						} else {
 							this.list = res.data.list || []
 						}
+						let nowT = new Date().valueOf() // 现在时间戳
+						this.list.map(item=>{
+							let orderT = new Date(item.orderTime).valueOf() // 下单时间戳
+							let tt = ((1800 * 1000) - (nowT - orderT))/1000  // 距离30分钟支付 相差时间戳  
+							item.leftTimeT = tt > 0 ? tt : 0
+						})
 						this.total = res.data.count || 0
 					} else {
 						this.list = []
@@ -277,15 +288,6 @@
 				this.searchParams = params
 				this.getRow(1)
 			},
-			// 支付剩余时间
-			filterTime (time) {
-				console.log(time,'tttttt')
-				let nowT = new Date().valueOf() // 现在时间戳
-				let orderT = new Date(time).valueOf() // 下单时间戳
-				let tt = (1800 * 1000) - (nowT - orderT)   // 距离30分钟支付 相差时间戳  
-				console.log(tt,'tttttt')
-				return  tt
-			},
 			
 			// 跳转到设置支付密码页
 			toSetPwd () {

+ 3 - 2
pages/order/orderDetail.vue

@@ -91,9 +91,10 @@
 					<text class="num-big">{{totalPrice}}</text>乐豆
 				</view>
 				<view class="footer">
-					<u-input v-model="password" 
+					<input v-model="password" 
 					@confirm="toPayOrder" 
-					maxlength="30" input-align="center" type="password" 
+					maxlength="30" 
+					style="text-align: center;" type="password" 
 					placeholder="请输入支付密码" />
 				</view>
 				<view class="fot-btn">

+ 5 - 2
pages/toOrder/index.vue

@@ -84,9 +84,9 @@
 					<text class="num-big">{{totalPrice}}</text>乐豆
 				</view>
 				<view class="footer">
-					<u-input v-model="password" 
+					<input v-model="password" 
 					maxlength="30" 
-					input-align="center" 
+					style="text-align: center;"
 					type="password" 
 					@confirm="toPay"
 					placeholder="请输入支付密码" />
@@ -130,6 +130,7 @@
 		},
 		onLoad() {
 			this.goodsList = this.$store.state.vuex_toOrderList
+			// console.log(this.goodsList,'llllllllllll')
 			// 监听设置密码是否成功
 			uni.$once('setPswSuccess', this.setPsw)
 		},
@@ -257,6 +258,8 @@
 							this.orderId = res.data.id
 							// 校验用户是否设置过支付密码
 							this.toCheckPwd()
+							// 刷新购物车
+							uni.$emit('getCartList')
 						} else {
 							uni.showToast({
 								title: res.message,

+ 1 - 11
pages/userCenter/ldDetailed.vue

@@ -130,19 +130,9 @@
 						this.listdata = []
 						this.total = 0
 					}
-					this.status = "loadmore"
+					this.status = "nomore"
 				})
 			},
-			// scroll-view到底部加载更多
-			onreachBottom() {
-				if(this.listdata.length < this.total){
-					this.pageNo += 1
-					this.searchHandle()
-				}else{
-					uni.showToast({ title: '已经到底了', icon: 'none' })
-					this.status = "nomore"
-				}
-			}
 		}
 	}
 </script>

二进制
static/checked.png


二进制
static/uncheck.png