Browse Source

增加垃圾类型图标

lilei 4 years ago
parent
commit
2ee66edcca

+ 15 - 0
pages/index/index.vue

@@ -55,6 +55,9 @@
 		updateGoodsBuyQty
 	} from '@/api/shoppingCart.js'
 	import {bannerList} from '@/api/banner.js'
+	import {
+		getLookUpDatas
+	} from '@/api/data.js'
 	export default {
 		data() {
 			return {
@@ -80,6 +83,8 @@
 			}
 		},
 		onLoad() {
+			// 获取订单状态数据字典
+			this.getCodeList('RUBBISH_TYPE','vuex_rubbishType')
 			// 获取顶部轮播图
 			this.getbannerList()
 			// 查询购物车列表
@@ -98,6 +103,16 @@
 			})
 		},
 		methods: { 
+			// 获取数据字典
+			getCodeList(code,key) {
+				getLookUpDatas({
+					type: code
+				}).then(res => {
+					if (res.status == 200) {
+						this.$u.vuex(key, res.data)
+					}
+				})
+			},
 			// 获取banner
 			getbannerList(){
 				bannerList({type:'banner',location:'MALL_TOP'}).then(res=>{

+ 4 - 9
pages/userCenter/deliveryRecord.vue

@@ -7,7 +7,7 @@
 				<view class="cell-item" v-for="(item, index) in listdata" :key="index">
 					<text class="cell-item-date">{{item.deliveryTime}}</text>
 					<view class="cell-item-main">
-						<u-image width="100rpx" height="100rpx" :src="item.pic" class="cell-item-pic"></u-image>
+						<u-image width="100rpx" height="100rpx" :src="`/static/${item.rubbishType}.png`" class="cell-item-pic"></u-image>
 						<view class="cell-item-r">
 							<view class="cell-item-head">
 								<view class="cell-item-val">
@@ -38,21 +38,18 @@
 	export default {
 		data() {
 			return {
-				listdata: [
-					// {  tit: '255', time: '2020-11-4 10:11', pic: '', price: '38', label: '撒健康的国家啥都给交撒旦教撒健康的国家啥都给交撒旦撒健给交撒旦教' },
-					// {  tit: '255', time: '2020-11-4 10:11', pic: '', price: '38', label: '撒健康的国家啥旦教' },
-				],
+				listdata: [],
 				pageNo: 1,  //  当前页码
 				pageSize: 10,  //  每页条数
 				total: 0,  //  数据总条数
 				noDataText: '暂无数据',  //  列表请求状态提示语
 				status: 'loadmore',  //  加载中状态
+				rubbishType: []
 			}
 		},
 		onShow() {
 			this.searchHandle(1)
-		},
-		onLoad() {
+			this.rubbishType = this.$store.state.vuex_rubbishType
 		},
 		methods:{
 			// 搜索查询
@@ -62,7 +59,6 @@
 				getDeliveryLogList({
 					pageNo: this.pageNo,
 					pageSize: this.pageSize,
-					// queryWord: this.queryValue
 				}).then(res => {
 					if (res.status == 200) {
 						if(this.pageNo>1){
@@ -71,7 +67,6 @@
 							this.listdata = res.data.list || []
 						}
 						this.total = res.data.count || 0
-						this.listdata.length == 0 && this.queryValue != '' ? this.noDataText = '没有搜索到相关结果' : this.noDataText = '暂无数据'
 					} else {
 						this.noDataText = res.message
 						this.listdata = []

BIN
static/CLOTHES.png


+ 0 - 0
static/dhai.png → static/HARM.png


BIN
static/METAL.png


+ 0 - 0
static/zhizhang.png → static/PAPER.png


BIN
static/PLASTIC.png


BIN
static/jinshou.png


BIN
static/yw.png


+ 3 - 1
store/index.js

@@ -117,7 +117,9 @@ const store = new Vuex.Store({
 		// 当前网络连接状态
 		vuex_netStatus: '',
 		// 客服电话
-		vuex_kfMobile: ''
+		vuex_kfMobile: '',
+		// 垃圾箱类型
+		vuex_rubbishType: []
 	},
 	mutations: {
 		$uStore(state, payload) {